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.

Showing 1-10 of 26 results. Next

A062028 a(n) = n + sum of the digits of n.

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 77
Offset: 0

Views

Author

Amarnath Murthy, Jun 02 2001

Keywords

Comments

a(n) = A248110(n,A007953(n)). - Reinhard Zumkeller, Oct 01 2014

Examples

			a(34) = 34 + 3 + 4 = 41, a(40) = 40 + 4 = 44.
		

Crossrefs

Indices of: A047791 (primes), A107743 (composites), A066564 (squares), A084661 (cubes).
Iterations: A004207 (start=1), A016052 (start=3), A007618 (start=5), A006507 (start=7), A016096 (start=9).

Programs

  • Haskell
    a062028 n = a007953 n + n  -- Reinhard Zumkeller, Oct 11 2013
    
  • Maple
    with(numtheory): for n from 1 to 100 do a := convert(n,base,10):
    c := add(a[i],i=1..nops(a)): printf(`%d,`,n+c); od:
    A062028 := n -> n+add(i,i=convert(n,base,10)) # M. F. Hasler, Nov 08 2018
  • Mathematica
    Table[n + Total[IntegerDigits[n]], {n, 0, 100}]
  • PARI
    A062028(n)=n+sumdigits(n) \\ M. F. Hasler, Jul 19 2015
    
  • Python
    def a(n): return n + sum(map(int, str(n)))
    print([a(n) for n in range(71)]) # Michael S. Branicky, Jan 09 2023

Formula

a(n) = n + A007953(n).
a(n) = A160939(n+1) - 1. - Filip Zaludek, Oct 26 2016

Extensions

More terms from Vladeta Jovovic, Jun 05 2001

A048519 Prime plus its digit sum equals a prime.

Original entry on oeis.org

11, 13, 19, 37, 53, 59, 71, 73, 97, 101, 103, 127, 149, 163, 167, 181, 233, 257, 271, 277, 293, 307, 367, 383, 389, 419, 431, 433, 479, 499, 509, 547, 563, 587, 617, 631, 701, 727, 743, 787, 811, 839, 857, 859, 947, 1009, 1049, 1061, 1087, 1153, 1171
Offset: 1

Views

Author

Patrick De Geest, May 15 1999

Keywords

Comments

For any prime p, p +- digitsum(p, base b) can't be prime unless the base b is even, since in an odd base, an odd number always has an odd digit sum (powers of b are congruent to b (mod 2)), so p +- digitsum(p, base b) is even for odd b. This sequence is for b = 10 (where "-" is also excluded, see comment in A243442), see A243441 for b = 2. - M. F. Hasler, Nov 06 2018
See subsequence A048523 for primes which only once give another prime under iteration of A062028, and A048524 .. A048527, A320878 .. A320880 for primes starting longer chains. See A090009 for their initial terms, starting the earliest chain of given length. - M. F. Hasler, Nov 09 2018

Examples

			a(9) = prime 97 because 97 + sum-of-digits(97) = 97 + 16 = 113 also a prime.
		

Crossrefs

Cf. A007953 (digit sum), A062028 (n + digit sum of n), A047791 (A062028(n) is prime), A048520.

Programs

  • Haskell
    a048519 n = a048519_list !! (n-1)
    a048519_list = map a000040 $ filter ((== 1) . a010051' . a065073) [1..]
    -- Reinhard Zumkeller, Sep 27 2014
    
  • Magma
    [p: p in PrimesUpTo(1200) | IsPrime(q) where q is p+&+Intseq(p)]; // Vincenzo Librandi, Jan 30 2018
  • Maple
    select(n -> isprime(n) and isprime(n + convert(convert(n,base,10),`+`)), [$1..10^4]); # Robert Israel, Aug 10 2014
  • Mathematica
    Select[Prime[Range[500]],PrimeQ[#+Total[IntegerDigits[#]]]&] (* Harvey P. Dale, Oct 03 2011 *)
  • PARI
    select( is(p)=isprime(p+sumdigits(p))&&isprime(p), primes([0,2000])) \\ M. F. Hasler, Aug 08 2014, edited Nov 09 2018
    

Formula

Primes in A047791, i.e., intersection of A047791 and A000040. - M. F. Hasler, Nov 08 2018

A006378 Prime self (or Colombian) numbers: primes not expressible as the sum of an integer and its digit sum.

Original entry on oeis.org

3, 5, 7, 31, 53, 97, 211, 233, 277, 367, 389, 457, 479, 547, 569, 613, 659, 727, 839, 883, 929, 1021, 1087, 1109, 1223, 1289, 1447, 1559, 1627, 1693, 1783, 1873, 2099, 2213, 2347, 2437, 2459, 2503, 2549, 2593, 2617, 2683, 2729, 2819, 2953, 3023, 3067
Offset: 1

Views

Author

Keywords

References

  • M. Gardner, Time Travel and Other Mathematical Bewilderments. Freeman, NY, 1988, p. 116.
  • D. R. Kaprekar, Puzzles of the Self-Numbers. 311 Devlali Camp, Devlali, India, 1959.
  • D. R. Kaprekar, The Mathematics of the New Self Numbers, Privately Printed, 311 Devlali Camp, Devlali, India, 1963.
  • D. R. Kaprekar, The Mathematics of the New Self Numbers (Part V). 311 Devlali Camp, Devlali, India, 1967.
  • Jeffrey Shallit, personal communication c. 1999.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a006378 n = a006378_list !! (n-1)
    a006378_list = map a000040 $ filter ((== 0) . a107740) [1..]
    -- Reinhard Zumkeller, Sep 27 2014
    
  • Mathematica
    With[{nn=3200},Complement[Prime[Range[PrimePi[nn]]],Table[n+Total[ IntegerDigits[n]],{n,nn}]]] (* Harvey P. Dale, Dec 30 2011 *)
  • PARI
    select( is_A006378(n)=is_A003052(n)&&isprime(n), primes([1,3000])) \\ M. F. Hasler, Nov 08 2018

Formula

A107740(A049084(a(n))) = 0. [Corrected by Reinhard Zumkeller, Sep 27 2014]

A048520 Primes expressible as the sum of a prime plus its digit sum.

Original entry on oeis.org

13, 17, 29, 47, 61, 73, 79, 83, 103, 107, 113, 137, 163, 173, 181, 191, 241, 271, 281, 293, 307, 317, 383, 397, 409, 433, 439, 443, 499, 521, 523, 563, 577, 607, 631, 641, 709, 743, 757, 809, 821, 859, 877, 881, 967, 1019, 1063, 1069, 1103, 1163, 1181
Offset: 1

Views

Author

Patrick De Geest, May 15 1999

Keywords

Examples

			a(15) = 181 which is 167 + (1+6+7).
		

Crossrefs

Programs

  • Mathematica
    Sort[Select[Table[p=Prime[n];p+Total[IntegerDigits[p]],{n,195}],PrimeQ]] (* Jayanta Basu, May 03 2013 *)
    Select[#+Total[IntegerDigits[#]]&/@Prime[Range[200]],PrimeQ]//Sort (* Harvey P. Dale, Sep 02 2023 *)
  • PARI
    is_A048520(n)=#select(p->p+sumdigits(p)==n,primes([n-9*#digits(n),n-2]))&&isprime(n) \\ M. F. Hasler, Nov 08 2018

Extensions

Offset corrected to 1 by M. F. Hasler, Nov 08 2018

A107740 Number of numbers m such that prime(n) = m + (digit sum of m).

Original entry on oeis.org

1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 2, 2, 1, 1, 0, 1, 1, 0, 1
Offset: 1

Views

Author

Reinhard Zumkeller, May 23 2005

Keywords

Comments

a(A049084(A006378(n))) = 0; a(A049084(A048521(n))) > 0. [Corrected by Reinhard Zumkeller, Sep 27 2014]
a(n) <= 2 for n <= 10^5. Conjecture: sequence is bounded.
I would rather conjecture the opposite. Of course a(n) >= m implies n >= A006064(m), having more than A230857(m) digits, i.e., 14, 25 and 1111111111125 digits of n, for a(n) = 3, 4, 5. - M. F. Hasler, Nov 09 2018

Examples

			A000040(26) = 101 = 91 + (9 + 1) = 100 + (1 + 0 + 0): a(26) = # {91, 100} = 2.
		

Crossrefs

Programs

  • Haskell
    a107740 n = length [() | let p = a000040 n,
                             m <- [max 0 (p - 9 * a055642 p) .. p - 1],
                             a062028 m == p]
    -- Reinhard Zumkeller, Sep 27 2014
    
  • Mathematica
    Table[p=Prime[n];c=0;i=1;While[iJayanta Basu, May 03 2013 *)
  • PARI
    apply( A107740(n)=A230093(prime(n)), [1..150]) \\ M. F. Hasler, Nov 08 2018

Formula

a(n) = A230093(prime(n)), i.e.: A107740 = A230093 o A000040. - M. F. Hasler, Nov 08 2018

A090009 Begins the earliest length-n chain of primes such that any term in the chain equals the previous term increased by the sum of its digits.

Original entry on oeis.org

2, 11, 11, 277, 37783, 516493, 286330897, 286330897, 56676324799
Offset: 1

Views

Author

Joseph L. Pe, Jan 27 2004

Keywords

Comments

From the second term on, subsequence of A[2] := A048519. Due to the "exclusive" definition of this sequence, A048523(1) > a(2), but for k >= 3, a(k) = A[k](1) for A[3..9] = A048524 .. A048527, A320878 .. A320880. - M. F. Hasler, Nov 09 2018

Examples

			11 begins the earliest chain 11, 13, 17 of three primes such that any term in the chain equals the previous term increased by the sum of its digits, viz., 13 = 11 + 2, 17 = 13 + 4. Hence a(3) = 11.
		

Crossrefs

Cf. A047791, A048519, A062028 (n + digit sum of n).

Programs

Extensions

a(7)-a(8) from Donovan Johnson, Jan 08 2013
a(9) from Giovanni Resta, Jan 14 2013

A048523 Primes for which only one iteration of 'Prime plus its digit sum equals a prime' is possible.

Original entry on oeis.org

13, 19, 37, 53, 71, 73, 97, 103, 127, 163, 181, 233, 271, 307, 383, 389, 431, 433, 499, 509, 563, 587, 631, 701, 743, 787, 811, 857, 859, 947, 1009, 1049, 1061, 1087, 1153, 1171, 1223, 1283, 1423, 1483, 1489, 1553, 1597, 1601, 1607, 1733, 1801, 1861, 1867
Offset: 1

Views

Author

Patrick De Geest, May 15 1999

Keywords

Comments

Sequence A048519 lists the primes for which at least (rather than exactly) one iteration of A062028 is "possible". See A048524 .. A048527 and A320878 .. A320880 for further subsequences, and A090009 for the list of their initial terms, starting chains of length >= 3 .. 9. - M. F. Hasler, Nov 09 2018

Examples

			prime 1999 -> 1999 + (1+9+9+9) = prime 2027 -> next iteration yields composite 2038.
		

Crossrefs

Programs

  • Mathematica
    ppd1Q[n_]:=PrimeQ[Rest[NestList[#+Total[IntegerDigits[#]]&,n,2]]] == {True,False}; Select[Prime[Range[300]],ppd1Q] (* Harvey P. Dale, Nov 10 2011 *)

A048527 Primes for which only five iterations of 'Prime plus its digit sum equals a prime' are possible.

Original entry on oeis.org

516493, 1056493, 1427383, 1885943, 3166183, 3805183, 4241593, 6621283, 7646953, 12912283, 17987839, 32106493, 107152093, 120224773, 131144473, 133210873, 139388891, 142782877, 150326173, 155382923, 177865819, 184081943, 227795839, 242376877, 264174877
Offset: 1

Views

Author

Patrick De Geest, May 15 1999

Keywords

Examples

			516493 -> 516521 -> 516541 -> 516563 -> 516589 -> 516623 -> next iteration yields a composite.
		

Crossrefs

Cf. A047791, A048519, A062028 (n + digit sum of n).

Programs

Extensions

Offset changed to 1 and a(15)-a(24) from Lars Blomberg, Dec 04 2013

A048521 Primes expressible as the sum of an integer plus its digit sum.

Original entry on oeis.org

2, 11, 13, 17, 19, 23, 29, 37, 41, 43, 47, 59, 61, 67, 71, 73, 79, 83, 89, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 223, 227, 229, 239, 241, 251, 257, 263, 269, 271, 281, 283, 293, 307, 311, 313
Offset: 1

Views

Author

Patrick De Geest, May 15 1999

Keywords

Examples

			a(24) = prime 113 which is 106 + (1+0+6) (or 97 + (9+7)).
		

Crossrefs

Programs

  • Haskell
    a048521 n = a048521_list !! (n-1)
    a048521_list = map a000040 $ filter ((> 0) . a107740) [1..]
    -- Reinhard Zumkeller, Sep 27 2014
  • Mathematica
    t={};Do[p=Prime[n];c=0;i=1;While[iJayanta Basu, May 03 2013 *)
    Union[Select[Table[n+Total[IntegerDigits[n]],{n,400}],PrimeQ]] (* Harvey P. Dale, Jul 14 2014 *)

Formula

A107740(A049084(a(n))) > 0.

Extensions

Formula and also offset corrected by Reinhard Zumkeller, Sep 27 2014

A320878 Primes such that iteration of A062028 (n + its digit sum) yields 6 primes in a row.

Original entry on oeis.org

286330897, 286330943, 388098901, 955201943, 1776186851, 1854778853, 2559495863, 2647782901, 3517793911, 3628857863, 3866728909, 3974453911, 4167637819, 4269837799, 5083007887, 5362197829, 5642510933, 6034811933, 8180784851, 8214319903
Offset: 1

Views

Author

Zak Seidov and M. F. Hasler, Nov 08 2018

Keywords

Comments

In contrast to A048523, ..., A048527, this definition uses "at least" for the number of successive primes. This allows easier computation of subsequences of terms which yield even more primes in a row.
One can nonetheless compute the terms of this sequence by considering possible pre-images under A062028 of terms of A048527. This gives the terms which yield exactly 6 primes in a row (i.e., A320878 \ A320879), and one has to take the union with further iterates of this procedure (which successively yields A320879 \ A320880, etc).

Crossrefs

Cf. A062028 (n + digit sum of n), A047791 (A062028(n) is prime), A048519 (primes among these).
a(1) = A090009(7) = start of first chain of 7 primes under iteration of A062028.
Cf. A230093 (number of m s.th. m + (sum of digits of m) = n) and references there.

Programs

  • PARI
    is_A320878(n,p=n)={for(i=1,6, isprime(p=A062028(p))||return);isprime(n)}
    forprime(p=286e6,,is_A320878(p)&& print1(p","))
    /* much faster, using the precomputed array A048527, as follows: */
    PP(n)=select(p->p+sumdigits(p)==n,primes([n-9*#digits(n),n-2])) \\ Returns list of prime predecessors for A062028. (PP(n) nonempty <=> n in A320881.)
    A320878=[]; my(S=A048527); while(#S=Set(concat(apply(PP,S))), A320878=setunion(A320878,S)) \\ Yields 211 terms from A048527[1..3000]

Formula

Numbers n in A048519 for which A062028(n) is in A048527, form the subset A320878 \ A320879.
Showing 1-10 of 26 results. Next