(A) In determining whether an applicant is the child or parent of a fully or currently insured individual for purposes of this subchapter, the Commissioner of Social Security shall apply such law as would be applied in determining the devolution of intestate personal property by the courts of the State in which such insured individual is domiciled at the time such applicant files application, or, if such insured individual is dead, by the courts of the State in which he was domiciled at the time of his death, or, if such insured individual is or was not so domiciled in any State, by the courts of the District of Columbia. Applicants who according to such law would have the same status relative to taking intestate personal property as a child or parent shall be deemed such.
(B) If an applicant is a son or daughter of a fully or currently insured individual but is not (and is not deemed to be) the child of such insured individual under subparagraph (A), such applicant shall nevertheless be deemed to be the child of such insured individual if such insured individual and the mother or father, as the case may be, of such applicant went through a marriage ceremony resulting in a purported marriage between them which, but for a legal impediment described in the last sentence of paragraph (1)(B), would have been a valid marriage.