cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A060291 Number of twin Harshads, including overlaps, whose sum is prime and where the 2nd Harshad is <= 10^n.

Original entry on oeis.org

7, 8, 21, 60, 278, 1520, 9583, 61835, 419705, 3023007, 22597508
Offset: 1

Views

Author

Enoch Haga, Mar 24 2001

Keywords

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.)
		

Crossrefs

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