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.

A060289 Number of distinct (non-overlapping) twin Harshad numbers whose sum is prime and where the 2nd Harshad is <= 10^n.

This page as a plain text file.
%I A060289 #16 Jan 19 2021 03:58:14
%S A060289 4,5,17,53,250,1404,9013,58608,401614,2908740,21832530
%N A060289 Number of distinct (non-overlapping) twin Harshad numbers whose sum is prime and where the 2nd Harshad is <= 10^n.
%F A060289 Generate the twin Harshads whose sum is prime. Count how many there are where the 2nd Harshad in the pair is <= a consecutive power of 10.
%e A060289 a(1)=4 because there are four pairs of Harshads whose sum is prime and the 2nd Harshad in the pair is <=10; these are 1+2=3, 3+4=7, 5+6=11, 9+10=19. 8+9=17 is not included because this pair overlaps 7+8=15, which also happens to be not prime. (Another sequence might include such overlapping pairs.)
%t A060289 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, If[PrimeQ[2*k - 1],c++;If[k > p, n++; AppendTo[s, c-1]; p *= 10]]; q1 = False, q1 = q2];  k++]; s (* _Amiram Eldar_, Jan 19 2021 *)
%o A060289 (PARI) Niven(n)=n%sumdigits(n)==0
%o A060289 a(n)=my(t,s); for(k=1,10^n,if(Niven(k), if(isprime(t+k), t=-10^n; s++); t=k)); s \\ _Charles R Greathouse IV_, Jan 23 2014
%Y A060289 Cf. A005349, A060159, A060288, A060290, A060291.
%K A060289 nonn,base,more
%O A060289 1,1
%A A060289 _Enoch Haga_, Mar 23 2001
%E A060289 a(8)-a(11) from _Amiram Eldar_, Jan 19 2021