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-6 of 6 results.

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

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]

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

A107741 Smallest number m such that prime(n) = m + (digit sum of m), a(n)=0 if no such m exists.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, May 23 2005

Keywords

Comments

If a(n)>0 then: A000040(n)=A062028(a(n)) and A107740(n)>0.

Crossrefs

Programs

  • Haskell
    a107741 n = if null ms then 0 else head ms  where
       ms = [m | let p = a000040 n,
                 m <- [max 0 (p - 9 * a055642 p) .. p - 1], a062028 m == p]
    -- Reinhard Zumkeller, Sep 27 2014

Extensions

Data error corrected by Reinhard Zumkeller, Sep 27 2014

A048528 Primes expressible in two ways as the sum of an integer and its digit sum.

Original entry on oeis.org

101, 103, 107, 109, 113, 307, 311, 313, 317, 509, 521, 709, 719, 911, 919, 1009, 1013, 1213, 1217, 1409, 1607, 1609, 1613, 1619, 1621, 1811, 1823, 2017, 2027, 2111, 2113, 2309, 2311, 2521, 2711, 2713, 2719, 2917, 2927, 3011, 3209, 3217, 3221, 3407, 3413, 3613, 3617, 3623
Offset: 1

Views

Author

Patrick De Geest, May 15 1999

Keywords

Examples

			313 = 296 + (2+9+6) and 313 = 305 + (3+0+5).
		

Crossrefs

Programs

  • Mathematica
    Transpose[Select[Tally[Select[#+Total[IntegerDigits[#]]&/@ Range[ 5000], PrimeQ]],#[[2]]==2&]][[1]] (* Harvey P. Dale, May 09 2013 *)
  • Python
    from collections import Counter
    from sympy import isprime
    def a_list(upto):
        return [i for i, j in Counter([i+sum(map(int, str(i))) for i in range(upto)]).items() if j>1 and isprime(i)]
    print(a_list(4000)) # Nicholas Stefan Georgescu, Mar 02 2023

Extensions

Corrected and extended by Harvey P. Dale, May 09 2013

A224966 Numbers n such that n^2+sum-of-digits(n^2) is prime.

Original entry on oeis.org

1, 4, 10, 16, 31, 32, 40, 41, 43, 62, 71, 76, 94, 95, 97, 98, 121, 142, 158, 163, 164, 166, 179, 188, 208, 211, 214, 227, 229, 259, 260, 265, 284, 301, 313, 317, 320, 328, 331, 340, 352, 355, 356, 365, 380, 382, 386, 392, 397, 401, 418, 424, 425, 431, 436, 439
Offset: 1

Views

Author

Keywords

Comments

This is the sequence of indices of prime numbers in A171613.
The Ulam spiral for this sequence is a near-perfect line y=-x (see links).

Examples

			a(12)=76 because 76^2=5776, and 5776+(5+7+7+6)=5801, which is prime.
		

Crossrefs

Cf. A048521.
Cf. numbers of the form n^2+sum-of-digits(n^2) A171613, and subsets A171614, A171615.
Cf. A062028.

Programs

  • R
    library(gmp); digsum<-function(x) sum(as.numeric(unlist(strsplit(as.character(x),split=""))))
    ans=as.bigz(rep(0,100)); n=1; i=as.bigz(1)
    while(n<=100) {
    if(isprime((w=i^2+digsum(i^2)))) ans[(n=n+1)-1]=i
    i=i+1
    }; ans
Showing 1-6 of 6 results.