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!)
A060288 Distinct (non-overlapping) twin Harshad numbers whose sum is prime. 4

%I #18 Jan 19 2021 05:49:01

%S 3,7,11,19,41,401,419,449,881,1021,1259,1289,1471,1601,1607,1871,1999,

%T 2029,2281,2549,2609,2833,3041,3359,3457,4001,4049,4481,4801,5641,

%U 6329,7499,7561,8081,8849,8929,9613,9619,10321,11131,12401,12799,13033

%N Distinct (non-overlapping) twin Harshad numbers whose sum is prime.

%C Suggested by Puzzle 129, The Prime Puzzles and Problems Connection.

%H Amiram Eldar, <a href="/A060288/b060288.txt">Table of n, a(n) for n = 1..10000</a>

%H Carlos Rivera, <a href="https://www.primepuzzles.net/puzzles/puzz_129.htm">Puzzle 129. Earliest sets of K consecutive Harshad Numbers</a>, The Prime Puzzles and Problems Connection.

%e a(3)=19, a prime, because the first Harshad number is 9 and the second is 10 and 9+10=19. To find the Harshad numbers take H1=(p-1)/2 as the first Harshad and then the second Harshad, H2=H1+1. Harshad numbers are those which have integral quotients after division by the sum of their digits. Note that 2+3=5 is not included because 1+2=3 are the first twins whose sum is prime and the next twins, 3+4=7, must not overlap the preceding pair.

%t harshadQ[n_] := Divisible[n, Plus @@ IntegerDigits[n]]; s = {}; q1 = True; Do[q2 = harshadQ[n]; If[q1 && q2, If[PrimeQ[2*n - 1], AppendTo[s, 2*n - 1]]; q1 = False, q1 = q2], {n, 2, 5000}]; s (* _Amiram Eldar_, Jan 19 2021 *)

%o (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-1; 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<10000001 then 30; 170 print Pt;

%Y Cf. A005349, A060159, A060289, A060290, A060291.

%K easy,nonn,base

%O 1,1

%A _Enoch Haga_, Mar 23 2001

%E Offset corrected by _Amiram Eldar_, Jan 19 2021

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 08:51 EDT 2024. Contains 371268 sequences. (Running on oeis4.)