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 13 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

A047791 Numbers n such that n plus digit sum of n (A007953) equals a prime.

Original entry on oeis.org

1, 10, 11, 13, 14, 16, 19, 32, 34, 35, 37, 52, 53, 56, 58, 59, 71, 73, 76, 91, 92, 94, 95, 97, 100, 101, 103, 104, 106, 122, 124, 127, 128, 142, 143, 146, 149, 160, 163, 166, 167, 181, 182, 184, 185, 215, 217, 218, 232, 233, 238, 250, 253, 256, 257, 271, 272
Offset: 1

Views

Author

Keywords

Examples

			Digit sum of 13 = 1 + 3 = 4 -> 13 + 4 = 17 is prime.
		

Crossrefs

Programs

  • Haskell
    a047791 n = a047791_list !! (n-1)
    a047791_list = filter ((== 1) . a010051' . a062028) [1..]
    -- Reinhard Zumkeller, Sep 27 2014
    
  • Mathematica
    Select[Range[272],PrimeQ[#+Total[IntegerDigits[#]]]&] (* Jayanta Basu, May 03 2013 *)
  • PARI
    select( is(n)=isprime(n+sumdigits(n)), [1..300]) \\ M. F. Hasler, Nov 08 2018

Formula

Complement of A107743.
A062028^(-1)(A000040). - M. F. Hasler, Nov 08 2018

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Nov 16 2000

A230093 Number of values of k such that k + (sum of digits of k) is n.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Oct 10 2013

Keywords

Comments

a(n) is the number of times n occurs in A062028.
For n>=1, a(10^n) = a(9*n-1). - Max Alekseyev, Feb 23 2021

Crossrefs

Cf. A006064, A007953 (sum of digits), A062028 (n + sum of its digits), A004207, A228085, A003052, A176995, A225793, A230094, A055642.
Cf. A107740 (this applied to primes).

Programs

  • Haskell
    a230093 n = length $ filter ((== n) . a062028) [n - 9 * a055642 n .. n]  -- Reinhard Zumkeller, Oct 11 2013
    
  • Maple
    # Maple code for A062028, A230093, A003052, A225793, A230094.
    with(LinearAlgebra):
    read transforms; # to get digsum
    M := 1000; A062028 := Array(0..M); A230093 := Array(0..M);
    for n from 0 to M do
       m := n+digsum(n);
       A062028[n] := m;
       if m <= M then A230093[m] := A230093[m]+1; fi;
    od:
    t1:=[seq(A062028[i],i=0..M)]; # A062028 as list (but incorrect offset 1)
    t2:=[seq(A230093[i],i=0..M)]; # A230093 as list, but then a(0) has index 1
    # A003052 := COMPl(t1); # COMPl has issues, may be incorrect for M <> 1000
    ctmax:=4;
    for h from 0 to ctmax do ct[h] := []; od:
    for i from 1 to M do
       h := lis2[i];
       if h <= ctmax then ct[h] := [op(ct[h]),i]; fi;
    od:
    A225793 := ct[1]; A230094 := ct[2]; # A003052 := ct[0]; # see there for better code
  • Mathematica
    Module[{nn=110,a,b,c,d},a=Tally[Table[x+Total[IntegerDigits[x]],{x,0,nn}]];b=a[[All,1]];c={#,0}&/@Complement[Range[nn],b];d=Sort[Join[a,c]];d[[All, 2]]] (* Harvey P. Dale, Jun 12 2019 *)
  • PARI
    apply( A230093(n)=sum(i=n>0,min(9*logint(n+!n,10)+8,n\2),sumdigits(n-i)==i), [1..150]) \\ M. F. Hasler, Nov 08 2018

Extensions

Edited by 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]

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

A065073 a(n) = prime(n) + (sum of digits of prime(n)).

Original entry on oeis.org

4, 6, 10, 14, 13, 17, 25, 29, 28, 40, 35, 47, 46, 50, 58, 61, 73, 68, 80, 79, 83, 95, 94, 106, 113, 103, 107, 115, 119, 118, 137, 136, 148, 152, 163, 158, 170, 173, 181, 184, 196, 191, 202, 206, 214, 218, 215, 230, 238, 242, 241, 253, 248, 259, 271, 274, 286
Offset: 1

Views

Author

Bodo Zinser, Nov 09 2001

Keywords

Examples

			a(5) = 13 because p(5) = 11 and 11 + (1 + 1) = 13.
		

Crossrefs

Programs

  • Haskell
    a065073 = a062028 . a000040  -- Reinhard Zumkeller, Sep 27 2014
    
  • Magma
    [NthPrime(n) + &+Intseq(NthPrime(n), 10): n in [1..80]]; // Vincenzo Librandi, Nov 07 2018
  • Mathematica
    Table[ Prime[n] + Apply[ Plus, IntegerDigits[ Prime[n]]], {n, 1, 75} ]
  • PARI
    forprime(p=2,300,print1(p+sumdigits(p),",")) \\ Edited by M. F. Hasler, Nov 06 2018
    
  • PARI
    A065073(n)=sumdigits(n=prime(n))+n \\ M. F. Hasler, Nov 06 2018
    

Formula

a(n) = A062028(A000040(n)). - M. F. Hasler, Nov 06 2018

Extensions

More terms from Larry Reeves (larryr(AT)acm.org) and Robert G. Wilson v, Nov 13 2001

A320866 Primes such that p + digitsum(p, base 4) is again a prime.

Original entry on oeis.org

5, 7, 13, 17, 19, 37, 59, 67, 97, 127, 173, 193, 223, 233, 277, 359, 379, 439, 499, 563, 569, 599, 607, 631, 653, 691, 733, 769, 811, 821, 829, 877, 919, 929, 937, 967, 1009, 1019, 1087, 1093, 1163, 1193, 1213, 1223, 1229, 1297, 1319, 1373, 1399, 1423, 1481, 1483, 1559, 1571, 1597, 1613, 1619, 1627, 1657, 1699, 1733, 1777
Offset: 1

Views

Author

M. F. Hasler, Nov 06 2018

Keywords

Comments

Such primes exist only for even bases b. See A243441, A320867, A320868 and A048519 for the analog in base 2, 6, 8 and 10, respectively. Also, as in base 10, there are no such primes (except 5 and 7) when + is changed to -, see comment in A243442.

Examples

			5 = 4 + 1 = 11[4] (in base 4), and 5 + 1 + 1 = 7 is again prime.
		

Crossrefs

Cf. A047791, A048519 (base 10 analog), A048520, A006378, A107740, A243441 (base 2 analog: p + Hammingweight(p) is prime), A243442 (analog for p - Hammingweight(p)), A320867 (analog for base 6), A320868 (analog for base 8).

Programs

  • Mathematica
    Select[Prime[Range[300]],PrimeQ[#+Total[IntegerDigits[#,4]]]&] (* Harvey P. Dale, Feb 06 2020 *)
  • PARI
    forprime(p=1,1999,isprime(p+sumdigits(p,4))&&print1(p","))

A320867 Primes such that p + digitsum(p, base 6) is again a prime.

Original entry on oeis.org

11, 19, 23, 31, 41, 53, 61, 79, 109, 137, 151, 167, 179, 229, 233, 263, 271, 331, 347, 359, 419, 439, 467, 541, 557, 587, 599, 607, 653, 719, 797, 809, 839, 863, 997, 1019, 1049, 1097, 1109, 1237, 1283, 1291, 1301, 1321, 1373, 1427, 1439, 1487, 1523, 1549, 1607, 1621, 1697, 1709, 1733, 1741, 1867
Offset: 1

Views

Author

M. F. Hasler, Nov 06 2018

Keywords

Comments

Such primes exist only for an even base b. See A048519, A243441, A320866 and A320868 for the analog in base 10, 2, 4 and 8, respectively. Also, as in base 10, there are no such primes (except 7 and 11) when + is changed to -, see comment in A243442.

Examples

			11 = 6 + 5 = 15[6] (in base 6), and 11 + 1 + 5 = 17 is again prime.
		

Crossrefs

Cf. A047791, A048519 (base 10 analog), A048520, A006378, A107740, A243441 (base 2 analog: p + Hammingweight(p) is prime), A243442 (analog for p - Hammingweight(p)), A320866 (analog for base 4), A320868 (analog for base 8).

Programs

  • Maple
    filter:= n -> isprime(n) and isprime(n+convert(convert(n,base,6),`+`)):
    select(filter, [seq(i,i=3..2000,2)]); # Robert Israel, Mar 22 2020
  • PARI
    forprime(p=1,1999,isprime(p+sumdigits(p,6))&&print1(p","))

A320868 Primes such that p + digitsum(p, base 8) is again a prime.

Original entry on oeis.org

13, 29, 31, 41, 47, 61, 67, 71, 83, 97, 157, 193, 229, 241, 271, 283, 373, 397, 409, 431, 449, 467, 503, 587, 601, 607, 761, 787, 929, 971, 991, 1039, 1087, 1091, 1163, 1181, 1213, 1217, 1237, 1249, 1289, 1291, 1307, 1423, 1453, 1471, 1511, 1543, 1553, 1559, 1627, 1657, 1741, 1811, 1847, 1867, 1973, 1999
Offset: 1

Views

Author

M. F. Hasler, Nov 06 2018

Keywords

Comments

Such primes exist only for an even base b. See A048519, A243441, A320866 and A320867 for the analog in base 10, 2, 4 and 6, respectively. Also, as in base 10, there are no such primes (except 11 and 13) when + is changed to -, see comment in A243442.

Crossrefs

Cf. A047791, A048519 (base 10 analog), A048520, A006378, A107740, A243441 (base 2 analog: p + Hammingweight(p) is prime), A243442 (analog for p - Hammingweight(p)), A320866 (analog for base 4), A320867 (analog for base 6).

Programs

  • Maple
    digsum:= proc(n,b) convert(convert(n,base,b),`+`) end proc:
    select(p -> isprime(p) and isprime(p+digsum(p,8)), [seq(i,i=3..10000,2)]); # Robert Israel, Nov 07 2018
  • PARI
    forprime(p=1,1999,isprime(p+sumdigits(p,8))&&print1(p","))
Showing 1-10 of 13 results. Next