login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A060290 Primes which are sums of twin Harshad numbers (includes overlaps). 4
3, 5, 7, 11, 13, 17, 19, 41, 223, 401, 419, 449, 881, 1021, 1259, 1289, 1471, 1601, 1607, 1871, 1999, 2029, 2281, 2549, 2609, 2833, 3041, 3359, 3457, 4001, 4049, 4481, 4801, 4931, 5641, 6329, 7499, 7561, 8081, 8849, 8929, 9613, 9619, 10111, 10321 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
{n in A000040: (n-1)/2 in A005349 and (n+1)/2 in A005349}. - R. J. Mathar, Dec 20 2013
EXAMPLE
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.
MAPLE
isA005349 := proc(n)
if n mod digsum(n) = 0 then
true;
else
false;
end if;
end proc:
isA060290 := proc(n)
local h1 ;
if isprime(n) then
h1 := (n-1)/2 ;
if isA005349(h1) and isA005349(h1+1) then
true;
else
false;
end if;
else
false;
end if;
end proc:
for n from 3 to 20000 do
if isA060290(n) then
printf("%d, ", n) ;
end if;
end do: # R. J. Mathar, Dec 20 2013
MATHEMATICA
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 *)
PROG
(UBASIC)
20 A=0;
30 inc A;
40 if Ct=2 then Z=(A-1)+(A-2): if Z=prmdiv(Z) then print A-2; "+"; A-1; "="; Z; "/"; :inc Pt;
50 if Ct=2 then Ct=1:A=A-2;
60 X=1;
70 B=str(A);
80 L=len(B);
90 inc X;
100 S=mid(B, X, 1);
110 V=val(S):W=W+V;
120 if X<L then 90;
130 D=A/W:E=A\W: if D=E then inc Ct;
140 if Ct<>Dt+1 then Ct=0:Dt=0;
150 Dt=Ct:W=0;
160 if A<=10 then 30;
170 print Pt;
CROSSREFS
Sequence in context: A070739 A061244 A353137 * A096880 A069458 A062280
KEYWORD
easy,nonn,base
AUTHOR
Enoch Haga, Mar 24 2001
EXTENSIONS
Offset corrected by Amiram Eldar, Jan 19 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 02:23 EDT 2024. Contains 371264 sequences. (Running on oeis4.)