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.

Previous Showing 41-50 of 118 results. Next

A108662 Numbers whose sum of squares of digits is a prime.

Original entry on oeis.org

11, 12, 14, 16, 21, 23, 25, 27, 32, 38, 41, 45, 49, 52, 54, 56, 58, 61, 65, 72, 78, 83, 85, 87, 94, 101, 102, 104, 106, 110, 111, 113, 119, 120, 126, 131, 133, 137, 140, 146, 159, 160, 162, 164, 166, 168, 173, 179, 186, 191, 195, 197, 199, 201, 203, 205, 207, 210
Offset: 1

Views

Author

Zak Seidov, Jun 16 2005

Keywords

Comments

If m is in the sequence, then so are 10*m and any anagram (even with adding zeros between digits) of m. E.g., 12 is a term, hence 21, 102, 120, 201, 10020 all are here.
A sequence of primitive terms is of interest. It starts with 11, 12, 14, 16, 23, 25, 27, 38, 45, 49, 56, 58, 78, 111, 113, 119, 126, 133, 137, 146, 159, 166, 168, 179, 199. Note that digits are in nondecreasing order. - Zak Seidov, Dec 31 2013

Examples

			23 is in the sequence because 2^2 + 3^2 = 13 is a prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[300],PrimeQ[Total[IntegerDigits[#]^2]]&] (* Harvey P. Dale, May 25 2012 *)
  • PARI
    isok(n) = isprime(norml2(digits(n))); \\ Michel Marcus, Jan 09 2019

A072081 Numbers divisible by the square of the sum of their digits in base 10.

Original entry on oeis.org

1, 10, 20, 50, 81, 100, 112, 162, 200, 243, 324, 392, 400, 405, 500, 512, 605, 648, 810, 972, 1000, 1053, 1100, 1120, 1134, 1183, 1215, 1296, 1400, 1620, 1701, 1900, 1944, 2000, 2025, 2106, 2156, 2240, 2268, 2300, 2401, 2430, 2511, 2592, 2704, 2800, 2916
Offset: 1

Views

Author

Labos Elemer, Jun 14 2002

Keywords

Comments

If k is a term, then 10 * k is a term. There are an infinite number of terms that are not divisible by 10. The numbers m = 24 * 10^(42 * k - 40) +1, k >= 1, are divisible by 7^2 = digsum(m)^2. Also, the numbers s = 491 * 10^(42 * k - 8) + 3, k >= 1, are divisible by 17^2 = digsum(s)^2. - Marius A. Burtea, Mar 19 2020
The numbers 2^A095412(n), n >= 5, are terms. - Marius A. Burtea, Apr 02 2020

Examples

			k=9477, sumdigits(9477)=27, q=9477=27*27*13.
		

Crossrefs

Programs

  • Magma
    [k:k in [1..3000]| k mod &+Intseq(k)^2 eq 0]; // Marius A. Burtea, Mar 19 2020
    
  • Mathematica
    sud[x_] := Apply[Plus, IntegerDigits[x]] Do[s=sud[n]^2; If[IntegerQ[n/s], Print[n]], {n, 1, 10000}]
    Select[Range[3000],Divisible[#,Total[IntegerDigits[#]]^2]&] (* Harvey P. Dale, May 04 2011 *)
  • PARI
    for(n=1,10^4,s=sumdigits(n);if(!(n%s^2),print1(n,", "))) \\ Derek Orr, Apr 29 2015
    
  • Python
    def ok(n): return n and n%sum(di for di in map(int, str(n)))**2 == 0
    print([k for k in range(3000) if ok(k)]) # Michael S. Branicky, Jan 10 2025

A076313 a(n) = floor(n/10) - (n mod 10).

Original entry on oeis.org

0, -1, -2, -3, -4, -5, -6, -7, -8, -9, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, 8, 7, 6, 5, 4
Offset: 0

Views

Author

Reinhard Zumkeller, Oct 06 2002

Keywords

Comments

For n<100 equal to the negated alternating digital sum of n (see A055017). - Hieronymus Fischer, Jun 17 2007

Crossrefs

Programs

  • Haskell
    a076313 = uncurry (-) . flip divMod 10 -- Reinhard Zumkeller, Jun 01 2013
  • Mathematica
    Table[Floor[n/10]-Mod[n,10],{n,0,100}] (* or *) LinearRecurrence[{1,0,0,0,0,0,0,0,0,1,-1},{0,-1,-2,-3,-4,-5,-6,-7,-8,-9,1},100] (* Harvey P. Dale, Nov 02 2022 *)
  • PARI
    a(n)=n\10-n%10 \\ Charles R Greathouse IV, Jan 30 2012
    

Formula

From Hieronymus Fischer, Jun 17 2007: (Start)
a(n) = 11*floor(n/10)-n.
a(n) = (n-11*(n mod 10))/10.
a(n) = 11*A002266(A004526(n))-n=11*A004526(A002266(n))-n.
a(n) = (n-11*A010879(n))/10.
a(n) = (n-11*A000035(n)-22*A010874(A004526(n)))/10.
a(n) = (n-11*A010874(n)-55*A000035(A002266(n)))/10.
G.f.: x*(-8*x^10+11*x^9-1)/((1-x^10)*(1-x)^2). (End)

A080151 Let m = Wonderful Demlo number A002477(n); a(n) = sum of digits of m.

Original entry on oeis.org

1, 4, 9, 16, 25, 36, 49, 64, 81, 82, 85, 90, 97, 106, 117, 130, 145, 162, 163, 166, 171, 178, 187, 198, 211, 226, 243, 244, 247, 252, 259, 268, 279, 292, 307, 324, 325, 328, 333, 340, 349, 360, 373, 388, 405, 406, 409, 414, 421, 430, 441, 454, 469, 486, 487
Offset: 1

Views

Author

Eric W. Weisstein, Jan 31 2003

Keywords

Comments

Record values in A003132. - Reinhard Zumkeller, Jul 10 2011

Crossrefs

Programs

  • Haskell
    a n=(div n 9)*81+(mod n 9)^2
              A080151=map a [1..] \\ Chernin Nadav, Mar 06 2014
    
  • Maple
    f := n -> 9*n - 81*frac(1/9*n) + 81*frac(1/9*n)^2:
    map(f, [$1..100]); # Robert Israel, Aug 05 2019
  • Mathematica
    (* by direct counting *)
    Repunit[n_] := (-1 + 10^n)/9; A080151[n_]:=Plus @@ IntegerDigits[Repunit[n]^2];
    (* by the formula *)
    A080151[n_] := (9^2)*(n/9 - FractionalPart[n/9] + FractionalPart[n/9]^2)
    (* or alternatively *)
    A080151[n_] := 81*(Floor[n/9]+ FractionalPart[n/9]^2) (* Enrique Pérez Herrero, Nov 22 2009 *)
  • PARI
    vector(100, n, (n\9)*81+(n%9)^2) \\ Colin Barker, Mar 05 2014

Formula

a(n) = A007953(A002477(n)).
a(n) = sqrt( A080150(n) ).
a(n) = (9^2)*(n/9 - {n/9} + {n/9}^2) = 81*(floor(n/9) + {n/9}^2), where the symbol {n} means fractional part of n. - Enrique Pérez Herrero, Nov 22 2009
a(n) = A003132(A051885(n)). - Reinhard Zumkeller, Jul 10 2011
a(9*n + k) = 81*n + k^2, with k in range 0 to 9. - Enrique Pérez Herrero, Nov 05 2022
Empirical g.f.: x*(17*x^8 + 15*x^7 + 13*x^6 + 11*x^5 + 9*x^4 + 7*x^3 + 5*x^2 + 3*x + 1) / ((x-1)^2*(x^2+x+1)*(x^6+x^3+1)). - Colin Barker, Mar 05 2014
Empirical g.f. confirmed. - Robert Israel, Aug 05 2019

A376270 a(n) is the product of the leading digit of n and the sum of the squares of its digits.

Original entry on oeis.org

0, 1, 8, 27, 64, 125, 216, 343, 512, 729, 1, 2, 5, 10, 17, 26, 37, 50, 65, 82, 8, 10, 16, 26, 40, 58, 80, 106, 136, 170, 27, 30, 39, 54, 75, 102, 135, 174, 219, 270, 64, 68, 80, 100, 128, 164, 208, 260, 320, 388, 125, 130, 145, 170, 205, 250, 305, 370, 445, 530, 216, 222, 240, 270, 312, 366
Offset: 0

Views

Author

Michel Marcus, Sep 18 2024

Keywords

Crossrefs

b-elated function: A000120 (2), A376270 (10).

Programs

  • Maple
    a:= n-> (l-> l[-1]*add(i^2, i=l))(convert(n, base, 10)):
    seq(a(n), n=0..65);  # Alois P. Heinz, Sep 18 2024
  • Mathematica
    a[n_]:=First[d=IntegerDigits[n]]Norm[d]^2; Array[a,66,0] (* Stefano Spezia, Sep 18 2024 *)
  • PARI
    a(n) = if (n, my(d=digits(n)); d[1]*norml2(d), 0);
    
  • Python
    def a(n): return (d:=list(map(int, str(n))))[0] * sum(di*di for di in d)
    print([a(n) for n in range(66)]) # Michael S. Branicky, Sep 18 2024

Formula

a(n) = A000030(n)*A003132(n).

A055015 Sum of 6th powers of digits of n.

Original entry on oeis.org

0, 1, 64, 729, 4096, 15625, 46656, 117649, 262144, 531441, 1, 2, 65, 730, 4097, 15626, 46657, 117650, 262145, 531442, 64, 65, 128, 793, 4160, 15689, 46720, 117713, 262208, 531505, 729, 730, 793, 1458, 4825, 16354, 47385, 118378, 262873
Offset: 0

Views

Author

Henry Bottomley, May 31 2000

Keywords

Comments

The only fixed points (n = 0, 1 and 548834) are listed in row 6 of A252648. - M. F. Hasler, Apr 12 2015

Crossrefs

Programs

  • Magma
    [0] cat [&+[d^6: d in Intseq(n)]: n in [1..40]]; // Bruno Berselli, Feb 01 2013
    
  • Maple
    for n from 0 to 3 do seq(n^6+j^6, j=0..9 ); od; # Zerinvary Lajos, Nov 06 2006
  • Mathematica
    Table[Sum[DigitCount[n][[i]] i^6, {i, 9}], {n, 0, 40}] (* Bruno Berselli, Feb 01 2013 *)
  • PARI
    A055015(n)=sum(i=1,#n=digits(n),n[i]^6) \\ M. F. Hasler, Apr 12 2015

Formula

a(n) = Sum_{k>0} (floor(n/10^k) - 10*floor(n/10^(k+1)))^6. - Hieronymus Fischer, Jun 25 2007
a(10n+k) = a(n) + k^6, 0 <= k < 10. - Hieronymus Fischer, Jun 25 2007

A257588 If n = abcd... in decimal, a(n) = |a^2 - b^2 + c^2 - d^2 + ...|.

Original entry on oeis.org

0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 1, 0, 3, 8, 15, 24, 35, 48, 63, 80, 4, 3, 0, 5, 12, 21, 32, 45, 60, 77, 9, 8, 5, 0, 7, 16, 27, 40, 55, 72, 16, 15, 12, 7, 0, 9, 20, 33, 48, 65, 25, 24, 21, 16, 9, 0, 11, 24, 39, 56, 36, 35, 32, 27, 20, 11, 0, 13, 28, 45, 49
Offset: 0

Views

Author

N. J. A. Sloane, May 10 2015

Keywords

Comments

a(n) = 0 iff n is in A352535. - Bernard Schott, Jul 08 2022

Crossrefs

Programs

  • Haskell
    a257588 = abs . f 1 where
       f _ 0 = 0
       f s x = s * d ^ 2 + f (negate s) x' where (x', d) = divMod x 10
    -- Reinhard Zumkeller, May 10 2015
    
  • Maple
    a:= n-> (l-> abs(add(l[i]^2*(-1)^i, i=1..nops(l))))(convert(n, base, 10)):
    seq(a(n), n=0..70);  # Alois P. Heinz, Mar 24 2022
  • Mathematica
    Array[Abs@ Total@ MapIndexed[(2 Boole@ EvenQ[First[#2]] - 1) (#1^2) &, IntegerDigits[#]] &, 70] (* Michael De Vlieger, Feb 27 2022 *)
  • PARI
    a(n) = my(d=digits(n)); abs(sum(k=1, #d, (-1)^k*d[k]^2)); \\ Michel Marcus, Feb 27 2022
  • Python
    def A257588(n):
        return abs(sum((int(d)**2*(-1)**j for j,d in enumerate(str(n)))))
    # Chai Wah Wu, May 10 2015
    

A258881 a(n) = n + the sum of the squared digits of n.

Original entry on oeis.org

0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 11, 13, 17, 23, 31, 41, 53, 67, 83, 101, 24, 26, 30, 36, 44, 54, 66, 80, 96, 114, 39, 41, 45, 51, 59, 69, 81, 95, 111, 129, 56, 58, 62, 68, 76, 86, 98, 112, 128, 146, 75, 77, 81, 87, 95, 105, 117, 131, 147, 165, 96, 98, 102
Offset: 0

Views

Author

M. F. Hasler, Jul 19 2015

Keywords

Crossrefs

Cf. A003132, A062028, A259391, A259567, A033936, A076161 (indices of primes), A329179 (indices of squares).

Programs

  • Mathematica
    Total[Flatten@ {#, IntegerDigits[#]^2}] & /@ Range[0, 61] (* Michael De Vlieger, Jul 20 2015 *)
    Table[n+Total[IntegerDigits[n]^2],{n,0,100}] (* Harvey P. Dale, Nov 27 2022 *)
  • PARI
    A258881(n)=n+norml2(digits(n))
    
  • Python
    def ssd(n): return sum(int(d)**2 for d in str(n))
    def a(n): return n + ssd(n)
    print([a(n) for n in range(63)]) # Michael S. Branicky, Jan 30 2021

A001273 Smallest number that takes n steps to reach 1 under iteration of sum-of-squares-of-digits map (= smallest "happy number" of height n).

Original entry on oeis.org

1, 10, 13, 23, 19, 7, 356, 78999
Offset: 0

Views

Author

Keywords

Comments

Subsequent terms are too large to display in full.
a(8) = 3789 * 10^973 - 1 (3788 followed by 973 9's).
a(9) = 78889 * 10^((a(8) - 305)/81) - 1 (78888 followed by (421 * 10^973 - 34)/9 9's, specified by Warut Roonguthai for UPINT3).
a(10) = 259 * 10^((a(9) - 93)/81) - 1.
a(11) = 179 * 10^((a(10) - 114)/81) - 1.
a(12) = 47 * 10^((a(11) - 52)/81) - 1.
From Ya-Ping Lu, Jul 26 2025: (Start)
a(13) = 137 * 10^((a(12) - 46)/81) - 1.
a(14) = 1128 * 10^((a(13) - 55)/81) - 1.
a(15) = 58 * 10^((a(14) - 74)/81) - 1.
a(16) = 228 * 10^((a(15) - 57)/81) - 1. (End)

References

  • Richard K. Guy, Unsolved Problems in Number Theory, Sect. E34. (2nd ed. UPINT2 = 1994, 3rd ed. UPINT3 = 2004)

Crossrefs

Programs

  • Python
    f = lambda h: sum(int(d)**2 for d in str(h)); a = 356; n_mx = 19
    for n in range(7, n_mx+1):
        b = a%81; a1 = max(a%(2*3**(3*(n_mx+1-n))), b); t = max(a1//81-6,0); h = 1
        while f((h+1)*10**t - 1) != a1:
            h += 1; s = str(h)
            if '0' in s: p0 = s.index('0'); c = 10**(len(s)-p0); h = h//c*c + int(s[p0-1])*(c-1)//9
        c9 = str(h).count('9'); hc = h//(10**c9); a = (hc+1)*10**((a1-f(hc))//81)-1
        print('a(',n,') =', hc+1,'x 10 ^ ( ( a(',n-1,') -', f(hc),') / 81) - 1')  # Ya-Ping Lu, Jul 26 2025

Formula

For n >= 7, a(n) = k(n)*10^((a(n-1)-A003132(k(n)-1))/81)-1, where k(n) = 79, 3789, 78889, 259, 179, 47, 137, 1128, 58, 228, 19, 34, 145 for n = 7, 8,.., 19. - Ya-Ping Lu, Jul 27 2025

Extensions

a(7), a(8) from Jud McCranie, Sep 15 1994
a(9)-a(12) from Hans Havermann, May 02 2010
Edited by Hans Havermann, May 03 2010, May 04 2010

A175396 Numbers whose sum of squares of digits is a square.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 34, 40, 43, 50, 60, 68, 70, 80, 86, 90, 100, 122, 148, 184, 200, 212, 221, 236, 244, 263, 269, 296, 300, 304, 326, 340, 362, 366, 400, 403, 418, 424, 430, 442, 447, 474, 481, 488, 500, 600, 608, 623, 629, 632, 636, 663
Offset: 1

Views

Author

Ctibor O. Zizka, Apr 30 2010

Keywords

Comments

Previous name: Numbers n such that Sum_{i=1..r, x(i)^2} is a perfect square, where x(i) = digits of n. r=1+floor(log_10 n).

Examples

			34 is a term: 3^2 + 4^2 = 25 = 5^2.
122 is a term: 1^2 + 2^2 + 2^2 = 9 = 3^2.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 666], IntegerQ[Sqrt[Plus @@ (IntegerDigits[#]^2)]] &] (* Ivan Neretin, Aug 03 2015 *)
  • PARI
    isok(n) = {my(digs = digits(n)); issquare(sum(i=1, #digs, digs[i]^2))} \\ Michel Marcus, Jun 02 2013
    
  • Python
    from math import isqrt
    def ok(n): s = sum(int(i)**2 for i in str(n)); return isqrt(s)**2 == s
    print(*[k for k in range(664) if ok(k)], sep = ', ')  # Ya-Ping Lu, Jul 07 2025

Extensions

Corrected and extended by Neven Juric, Jul 12 2010
Simpler definition by Michel Marcus, Jun 02 2013
Previous Showing 41-50 of 118 results. Next