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.

A060290 Primes which are sums of twin Harshad numbers (includes overlaps).

This page as a plain text file.
%I A060290 #21 Jan 19 2021 03:58:29
%S A060290 3,5,7,11,13,17,19,41,223,401,419,449,881,1021,1259,1289,1471,1601,
%T A060290 1607,1871,1999,2029,2281,2549,2609,2833,3041,3359,3457,4001,4049,
%U A060290 4481,4801,4931,5641,6329,7499,7561,8081,8849,8929,9613,9619,10111,10321
%N A060290 Primes which are sums of twin Harshad numbers (includes overlaps).
%H A060290 Amiram Eldar, <a href="/A060290/b060290.txt">Table of n, a(n) for n = 1..10000</a>
%F A060290 {n in A000040:  (n-1)/2 in A005349 and (n+1)/2 in A005349}. - _R. J. Mathar_, Dec 20 2013
%e A060290 a(5)=17, a prime because the first Harshad number is 8 and the second is 9 and 8+9=17. In this sequence overlapping Harshad's are permitted: 1+2=3 and 2+3=5.
%p A060290 isA005349 := proc(n)
%p A060290     if n mod digsum(n) = 0 then
%p A060290         true;
%p A060290     else
%p A060290         false;
%p A060290     end if;
%p A060290 end proc:
%p A060290 isA060290 := proc(n)
%p A060290     local h1 ;
%p A060290     if isprime(n) then
%p A060290         h1 := (n-1)/2 ;
%p A060290         if isA005349(h1) and isA005349(h1+1) then
%p A060290             true;
%p A060290         else
%p A060290             false;
%p A060290         end if;
%p A060290     else
%p A060290         false;
%p A060290     end if;
%p A060290 end proc:
%p A060290 for n from 3 to 20000 do
%p A060290     if isA060290(n) then
%p A060290         printf("%d,",n) ;
%p A060290     end if;
%p A060290 end do: # _R. J. Mathar_, Dec 20 2013
%t A060290 harshadQ[n_] := Divisible[n, Plus @@ IntegerDigits[n]]; s = {}; q1 = True; Do[q2 = harshadQ[n]; If[q1 && q2 && PrimeQ[2*n - 1], AppendTo[s, 2*n - 1]]; q1 = q2, {n, 2, 5000}]; s (* _Amiram Eldar_, Jan 19 2021 *)
%o A060290 (UBASIC)
%o A060290 20 A=0;
%o A060290 30 inc A;
%o A060290 40 if Ct=2 then Z=(A-1)+(A-2): if Z=prmdiv(Z) then print A-2; "+"; A-1; "="; Z; "/"; :inc Pt;
%o A060290 50 if Ct=2 then Ct=1:A=A-2;
%o A060290 60 X=1;
%o A060290 70 B=str(A);
%o A060290 80 L=len(B);
%o A060290 90 inc X;
%o A060290 100 S=mid(B,X,1);
%o A060290 110 V=val(S):W=W+V;
%o A060290 120 if X<L then 90;
%o A060290 130 D=A/W:E=A\W: if D=E then inc Ct;
%o A060290 140 if Ct<>Dt+1 then Ct=0:Dt=0;
%o A060290 150 Dt=Ct:W=0;
%o A060290 160 if A<=10 then 30;
%o A060290 170 print Pt;
%Y A060290 Cf. A005349, A060159, A060288, A060289, A060291.
%K A060290 easy,nonn,base
%O A060290 1,1
%A A060290 _Enoch Haga_, Mar 24 2001
%E A060290 Offset corrected by _Amiram Eldar_, Jan 19 2021