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

A243442 Primes p such that, in base 2, p - digitsum(p) is also a prime.

Original entry on oeis.org

5, 23, 71, 83, 101, 113, 197, 281, 317, 353, 359, 373, 401, 467, 599, 619, 683, 739, 751, 773, 977, 1091, 1097, 1103, 1217, 1223, 1229, 1237, 1283, 1303, 1307, 1429, 1433, 1489, 1553, 1559, 1601, 1607, 1613, 1619, 1699, 1873, 1879, 2039, 2347, 2357, 2389
Offset: 1

Views

Author

Anthony Sand, Jun 05 2014

Keywords

Comments

In all bases b, x = n - digitsum(n) is always divisible by b-1, therefore x can be prime only in base 2 and bases b for which b-1 is prime. For example, in base 10, n - digitsum(n) is always divisible by 10 - 1 = 9 -- see A066568 and A068395. In base 8, 9 = 11, therefore 11 - digitsum(11) = 9 - 2 = 7 is divisible by 7.

Examples

			5 - digitsum(5,base=2) = 5 - digitsum(101) = 5 - 2 = 3.
23 - digitsum(10111) = 23 - 4 = 19.
71 - digitsum(1000111) = 71 - 4 = 67.
83 - digitsum(1010011) = 83 - 4 = 79.
101 - digitsum(1100101) = 101 - 4 = 97.
		

Crossrefs

Cf. A243441.

Programs

  • Mathematica
    Select[Prime[Range[400]],PrimeQ[#-Total[IntegerDigits[#,2]]]&] (* Harvey P. Dale, May 15 2019 *)
  • PARI
    isok(n) = isprime(n) && isprime(n - hammingweight(n)); \\ Michel Marcus, Jun 05 2014

A171181 n followed by (n - sum of digits of n).

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, 10, 9, 11, 9, 12, 9, 13, 9, 14, 9, 15, 9, 16, 9, 17, 9, 18, 9, 19, 9, 20, 18, 21, 18, 22, 18, 23, 18, 24, 18, 25, 18, 26, 18, 27, 18, 28, 18, 29, 18, 30, 27, 31, 27, 32, 27, 33, 27, 34, 27, 35, 27, 36, 27, 37, 27, 38, 27, 39, 27
Offset: 0

Views

Author

Marcel Hetkowski Fabeny (marcelfabeny(AT)yahoo.com.br), Dec 04 2009

Keywords

Examples

			a(0) = 0, a(1) = 0 - 0 = 0.
a(2) = 1, a(3) = 1 - 1 = 0.
a(4) = 2, a(5) = 2 - 2 = 0.
a(6) = 3, a(7) = 3 - 3 = 0.
		

Crossrefs

Interspersion of A001477 and A066568.

Programs

  • Mathematica
    Table[{n,n-Total[IntegerDigits[n]]},{n,0,40}]//Flatten (* Harvey P. Dale, Nov 26 2016 *)
  • PARI
    a(n) = if (n % 2 == 0, n/2, nn = n\2; d = digits(nn); nn - sum(i=1, #d, d[i]);); \\ Michel Marcus, Aug 14 2013

Formula

If n is even, a(n) = n/2; if n is odd, a(n) = A066568(floor(n/2)). - Michel Marcus, Aug 14 2013

Extensions

Edited by N. J. A. Sloane, Dec 05 2009

A229621 Numbers n such that n - (sum of digits of n) is a palindrome.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 420, 421, 422, 423, 424, 425, 426
Offset: 1

Views

Author

Derek Orr, Sep 26 2013

Keywords

Examples

			185 - (1+8+5) = 171 (a palindrome). Thus, 185 is a member of this sequence.
		

Crossrefs

Cf. A066568.

Programs

  • Mathematica
    Select[Range[0,500],PalindromeQ[#-Total[IntegerDigits[#]]]&]
  • PARI
    ispal(d) = Vecrev(d) == d;
    isok(n) = ispal(digits(n-sumdigits(n))); \\ Michel Marcus, Apr 11 2015
  • Python
    def ispal(n):
      r = ''
      for i in str(n):
        r = i + r
      return n == int(r)
    def DS(n):
      s = 0
      for i in str(n):
        s += int(i)
      return s
    {print(n, end=', ') for n in range(10**3) if ispal(n-DS(n))}
    ## Simplified by Derek Orr, Apr 10 2015
    

Extensions

More terms from Derek Orr, Apr 10 2015

A344853 a(n) = n minus (sum of digits of n in base 3).

Original entry on oeis.org

0, 0, 0, 2, 2, 2, 4, 4, 4, 8, 8, 8, 10, 10, 10, 12, 12, 12, 16, 16, 16, 18, 18, 18, 20, 20, 20, 26, 26, 26, 28, 28, 28, 30, 30, 30, 34, 34, 34, 36, 36, 36, 38, 38, 38, 42, 42, 42, 44, 44, 44, 46, 46, 46, 52, 52, 52, 54, 54, 54, 56, 56, 56, 60, 60, 60, 62, 62, 62
Offset: 0

Views

Author

Thomas König, May 30 2021

Keywords

Comments

All terms are even.
In all sequences of the form f(n) = n minus (sum of digits of n in base b), every term appears b times consecutively. Here b = 3, hence terms are entries of A346502 repeated 3 times. - Bernard Schott, Jul 21 2021

Examples

			a(20) = 20 - (2 + 0 + 2) = 16 because 20 is written as 202 in base 3.
		

Crossrefs

Cf. A011371 (in base 2), A066568 (in base 10).

Programs

  • Mathematica
    a[n_] := n - Plus @@ IntegerDigits[n, 3]; Array[a, 70, 0] (* Amiram Eldar, May 30 2021 *)
  • PARI
    a(n) = n - sumdigits(n, 3); \\ Michel Marcus, Jul 11 2021

Formula

a(n) = n - A053735(n).
a(n) = 2 * A054861(n).
a(n) = 2 * A004128(floor(n/3)).
a(3*n) = a(3*n+1) = a(3*n+2).

A356384 For any n >= 0, let x_n(1) = n, and for any b > 1, x_n(b) = x_n(b-1) minus the sum of digits of x_n(b-1) in base b; a(n) is the least b such that x_n(b) = 0.

Original entry on oeis.org

1, 2, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13
Offset: 0

Views

Author

Rémy Sigrist, Aug 05 2022

Keywords

Comments

This sequence is well defined: for any n >= 0: if x_n(b) > 0, then x_n(b+1) < x_n(b), and we must eventually reach 0.
This sequence is weakly increasing; this is related to the fact that for any base b > 1, k -> (k minus the sum of digits of k in base b) is weakly increasing.
Note that some values (like 7) do not appear in this sequence (see also A356386).

Examples

			For n = 42:
- we have:
      b  x(b)
      -  ----
      1    42
      2    39
      3    36
      4    33
      5    28
      6    20
      7    12
      8     7
      9     0
- so a(42) = 9.
		

Crossrefs

Programs

  • PARI
    See Links section.

A108638 Semiprime plus its digits is semiprime.

Original entry on oeis.org

15, 22, 26, 33, 38, 39, 49, 51, 55, 57, 74, 77, 115, 123, 129, 134, 145, 155, 161, 169, 178, 187, 202, 206, 213, 214, 221, 237, 254, 265, 274, 278, 291, 299, 301, 303, 309, 321, 327, 335, 361, 371, 377, 381, 382, 386, 411, 437, 445, 466, 478, 485, 497, 505
Offset: 1

Views

Author

Zak Seidov, Jun 14 2005

Keywords

Comments

Members k of A001358 such that A062028(k) is in A001358. - Robert Israel, Oct 01 2024
Surprisingly there are only three(?) semiprimes sp, 10,14,15, such that sp minus its digits is semiprime.
That is because n - (sum of its digits) = A066568(n) is divisible by 9. - Robert Israel, Oct 01 2024

Examples

			15=3*5 and 15+1+5=21=3*7.
		

Crossrefs

Programs

  • Maple
    filter:= n -> numtheory:-bigomega(n) = 2 and numtheory:-bigomega(n+convert(convert(n,base,10),`+`))=2:
    select(filter, [$1..1000]); # Robert Israel, Oct 01 2024
  • Mathematica
    Select[Range[500], Plus@@Last/@FactorInteger[ # ]==Plus@@Last/@FactorInteger[ #+Plus@@IntegerDigits[ # ]]==2&]

A225048 Numbers that cannot be expressed as n plus the sum of the squared digits of n for any integer n.

Original entry on oeis.org

1, 3, 4, 5, 7, 8, 9, 10, 14, 15, 16, 18, 19, 21, 22, 25, 27, 28, 29, 32, 33, 34, 35, 37, 38, 40, 43, 46, 47, 48, 49, 50, 52, 55, 57, 60, 61, 63, 64, 65, 70, 71, 73, 74, 78, 79, 82, 84, 85, 88, 89, 91, 92, 93, 94, 97, 99, 100, 104, 106, 109, 110, 115, 120, 122
Offset: 1

Views

Author

Keywords

Comments

A natural extension of the Self or Colombian numbers (A003052).
Up to 144, there are more numbers that cannot be expressed in this way than numbers that can. Thereafter, there are always more numbers that can.

Examples

			26 is not in the sequence, because 21+2^2+1^2=26. However, no such solution exists for 25 or 27.
		

Crossrefs

Programs

  • Mathematica
    nn=122;Complement[Range[nn],Table[n+Total[IntegerDigits[n]^2],{n,nn}]] (* Jayanta Basu, May 05 2013 *)
  • R
    digsqsum<-function(x) sum(as.numeric(unlist(strsplit(as.character(x),split="")))^2)
    which(is.na(match(1:1000,1:1000+sapply(1:1000,digsqsum)))

A225049 Numbers that can be expressed as n plus sum of squared digits(n) in more than one way.

Original entry on oeis.org

30, 41, 56, 81, 95, 96, 98, 101, 112, 114, 121, 125, 131, 142, 146, 152, 157, 168, 173, 177, 182, 186, 191, 196, 197, 199, 206, 209, 213, 215, 216, 217, 227, 230, 232, 234, 240, 243, 245, 247, 248, 257, 260, 262, 266, 272, 276, 284, 285, 287, 292, 299, 300
Offset: 1

Views

Author

Keywords

Examples

			a(13) = 131 is included because 131 = 57+5^2+7^2 = 73+7^2+3^2 = 105+1^2+5^2 = 122 + 1^2+4^2+4^2.
		

Crossrefs

Programs

  • R
    digsqsum<-function(x) sum(as.numeric(unlist(strsplit(as.character(x),split="")))^2)
    1:500+sapply(1:500,digsqsum)->y
    table(y)->ty; names(ty[ty>1])

A244573 Numbers n such that 10*n + d - digsum(10*n + d) is a palindrome for any d in {0,1,2,3,4,5,6,7,8,9}.

Original entry on oeis.org

1, 10, 18, 26, 34, 42, 68, 76, 84, 92, 100, 279, 368, 457, 546, 635, 724, 813, 902, 1000, 1071, 1152, 1233, 1314, 1486, 1567, 1648, 1729, 1981, 2051, 2132, 2213, 2385, 2466, 2547, 2628, 2709, 2880, 2961, 3031, 3112, 3284, 3365, 3446, 3527, 3608, 3699, 3860, 3941, 4011, 4183, 4264
Offset: 1

Views

Author

Derek Orr, Jun 30 2014

Keywords

Examples

			180 - (1+8+0) = 171, a palindrome. By adding {1,2,3,4,5,6,7,8,9} to 180 and subtracting that number's digsum, it will still be 171, a palindrome. Since 180 = 18*10, 18 is a member of this sequence.
		

Crossrefs

Programs

  • Mathematica
    palQ[n_]:=AnyTrue[Table[10n+d-Total[IntegerDigits[10n+d]],{d,0,9}],PalindromeQ]; Select[Range[4300],palQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 13 2021 *)
  • PARI
    rev(n)={r="";for(i=1,#digits(n),r=concat(Str(digits(n)[i]),r));return(eval(r))}
    for(n=1,10^4,s=sum(i=1,#digits(10*n),digits(10*n)[i]);if(rev(10*n-s)==10*n-s,print1(n,", ")))
Showing 1-10 of 14 results. Next