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!)
A253717 Primes equal to their partial cyclical digital sum numbers. 2

%I #23 May 07 2015 12:14:17

%S 2,3,5,7,11,13,17,31,53,71,101,131,157,173,181,197,211,283,431,439,

%T 457,461,487,509,571,601,643,727,911,929,1021,1031,1033,1051,1093,

%U 1151,1163,1171,1201,1231,1249,1259,1301,1303,1327,1373,1399,1429,1451,1453,1493

%N Primes equal to their partial cyclical digital sum numbers.

%C Subsequence of primes of A106039. - _Michel Marcus_, May 03 2015

%H Reinhard Zumkeller, <a href="/A253717/b253717.txt">Table of n, a(n) for n = 1..10000</a>

%e Prime(37) = 157 = (1+5+7)*12 + 1.

%e Prime(40) = 173 = (1+7+3)*15 + 1+7.

%e Prime(42) = 181 = (1+8+1)*18 + 1.

%t terms = {}; (Do[p = Prime[n]; iD = IntegerDigits[p]; iD[[0]] = 0;

%t a = Apply[Plus, iD]; pf = p - Mod[p, Floor[p/a]*a];

%t (Do[pf = pf + Apply[Plus, iD[[i]]];

%t If[pf == p, AppendTo[terms, pf]], {i, 0, IntegerLength[Prime[n]]}]), {n,

%t 1, 1000}]); Union[terms]

%o (PARI) isok(n) = {my(v = divrem(n, sumdigits(n))[2]); if (!v, return (1)); d = digits(n); for (i=1, #d, v -= d[i]; if (!v, return (1));); return (0);}

%o lista(nn) = forprime (n=1, nn, if (isok(n), print1(n, ", "))); \\ _Michel Marcus_, May 03 2015

%o (Haskell)

%o a253717 n = a253717_list !! (n-1)

%o a253717_list = filter ((== 1) . a010051') a106039_list

%o -- _Reinhard Zumkeller_, May 07 2015

%Y Cf. A257275.

%Y Cf. A106039.

%K nonn,base

%O 1,1

%A _V.J. Pohjola_, May 02 2015

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 April 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)