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.

A253717 Primes equal to their partial cyclical digital sum numbers.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 31, 53, 71, 101, 131, 157, 173, 181, 197, 211, 283, 431, 439, 457, 461, 487, 509, 571, 601, 643, 727, 911, 929, 1021, 1031, 1033, 1051, 1093, 1151, 1163, 1171, 1201, 1231, 1249, 1259, 1301, 1303, 1327, 1373, 1399, 1429, 1451, 1453, 1493
Offset: 1

Views

Author

V.J. Pohjola, May 02 2015

Keywords

Comments

Subsequence of primes of A106039. - Michel Marcus, May 03 2015

Examples

			Prime(37) = 157 = (1+5+7)*12 + 1.
Prime(40) = 173 = (1+7+3)*15 + 1+7.
Prime(42) = 181 = (1+8+1)*18 + 1.
		

Crossrefs

Cf. A257275.
Cf. A106039.

Programs

  • Haskell
    a253717 n = a253717_list !! (n-1)
    a253717_list = filter ((== 1) . a010051') a106039_list
    -- Reinhard Zumkeller, May 07 2015
  • Mathematica
    terms = {}; (Do[p = Prime[n]; iD = IntegerDigits[p]; iD[[0]] = 0;
      a = Apply[Plus, iD]; pf = p - Mod[p, Floor[p/a]*a];
      (Do[pf = pf + Apply[Plus, iD[[i]]];
        If[pf == p, AppendTo[terms, pf]], {i, 0, IntegerLength[Prime[n]]}]), {n,
       1, 1000}]); Union[terms]
  • 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);}
    lista(nn) = forprime (n=1, nn, if (isok(n), print1(n, ", "))); \\ Michel Marcus, May 03 2015