A060291 Number of twin Harshads, including overlaps, whose sum is prime and where the 2nd Harshad is <= 10^n.
7, 8, 21, 60, 278, 1520, 9583, 61835, 419705, 3023007, 22597508
Offset: 1
Examples
a(1)=7 because there are 7 pairs of Harshads whose sum is prime and the 2nd Harshad in the pair is <= 10; these are 1+2=3, 2+3=5, 3+4=7, 5+6=11, 6+7=13, 8+9=17, 9+10=19. (Another sequence does not permit overlapping Harshad numbers.)
Programs
-
Mathematica
harshadQ[n_] := Divisible[n, Plus @@ IntegerDigits[n]]; c = 0; p = 10; s = {}; n = 0; k = 2; q1 = True; While[n < 6, q2 = harshadQ[k]; If[q1 && q2 && PrimeQ[2*k-1], c++; If[k > p, n++; AppendTo[s, c-1]; p *= 10]]; q1 = q2; k++]; s (* Amiram Eldar, Jan 19 2021 *)
Formula
Generate the twin Harshads whose sum is prime. Count how many there are where the 2nd Harshad in the pair is <= to a consecutive power of 10.
Extensions
a(8)-a(11) from Amiram Eldar, Jan 19 2021
Comments