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

A066564 Numbers that when incremented by the sum of their digits produce a square.

Original entry on oeis.org

0, 2, 8, 17, 27, 38, 72, 86, 135, 161, 179, 216, 245, 275, 315, 347, 432, 467, 521, 558, 614, 662, 720, 770, 830, 882, 944, 998, 1016, 1080, 1145, 1220, 1278, 1355, 1433, 1512, 1583, 1664, 1746, 1829, 1922, 1998, 2016, 2111, 2189, 2286, 2384, 2483, 2583
Offset: 1

Views

Author

Amarnath Murthy, Dec 18 2001

Keywords

Examples

			179 is in the sequence because 179 + sum of digits of 179 = 179 + 17 = 196 which is a perfect square. - _Indranil Ghosh_, Feb 10 2017
		

Crossrefs

Programs

  • Magma
    [n: n in [0..3*10^3] | IsSquare(&+Intseq(n)+n)]; // Vincenzo Librandi, Jan 15 2016
  • Mathematica
    Select[Range[0,2600],IntegerQ[Sqrt[#+Total[IntegerDigits[#]]]]&] (* Harvey P. Dale, May 19 2012 *)
  • PARI
    digitsum(n) = local(s, d); s = 0; while(n>0, d = divrem(n, 10); n = d[1]; s = s+d[2]); s
    a066564(m) = local(n); for(n = 0, m, if(issquare(n+digitsum(n)), print1(n, ", ")))
    a066564(10000)
    
  • PARI
    isok(n) = issquare(n + sumdigits(n)); \\ Michel Marcus, Jan 15 2016
    

Extensions

More terms from Jason Earls, Dec 20 2001

A256577 Sum_{k>=0} (d_k)^(k+1)*10^k, where Sum_{k>=0} (d_k)*10^k is the decimal expansion of n.

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, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 490
Offset: 0

Views

Author

Michael De Vlieger, Apr 02 2015

Keywords

Comments

a(n) = n when 0 <= n < 20 or 10^i <= n < 10^i + 20 for some i>1.
a(n) = n if and only if every digit of n (in base 10), except possibly the ones digit, is 0 or 1. Otherwise, n < a(n). - Danny Rorabaugh, Apr 02 2015

Examples

			a(19) = 1^2 * 10^1 + 9^1 * 10^0 = 19.
a(20) = 2^2 * 10^1 + 0^1 * 10^0 = 40.
a(40) = 4^2 * 10^1 + 0^1 * 10^0 = 160.
a(199) = 1^3 * 10^2 + 9^2 * 10^1 + 9^1 * 10^0 = 100 + 810 + 9 = 919.
		

Crossrefs

Cf. A066566 (first 39 terms identical).
Cf. A255073 (primes that remain prime, no carry).

Programs

  • Mathematica
    Array[Total@ MapIndexed[#1^(#2)*10^(#2 - 1) & @@ {#1, First[#2]} &, Reverse@ IntegerDigits[#]] &, 71, 0] (* Michael De Vlieger, Nov 16 2022 *)
  • PARI
    vector(80, n, d = digits(n); sum(k=1, #d, d[k]^(#d-k+1)*10^(#d-k))) \\ Michel Marcus, Apr 09 2015

Extensions

Name and comments corrected by Paul Tek, Apr 11 2015

A321150 Primes p such that p minus its digit sum is a square.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 41, 43, 47, 97, 151, 157, 233, 239, 331, 337, 457, 593, 599, 743, 911, 919, 1301, 1303, 1307, 1531, 1783, 1787, 1789, 2039, 2311, 2617, 2939, 3613, 3617, 4373, 4783, 4787, 4789, 5641, 5647, 6581, 7079, 7591, 8111, 8117, 8677, 9239, 9829, 11681, 11689, 13001, 13003, 13007
Offset: 1

Views

Author

Marius A. Burtea, Oct 28 2018

Keywords

Examples

			11 is prime and 11 - (1+1) = 9 = 3^2 is square, so 11 is a term of the sequence.
457 is prime and 457 - (4+5+7) = 441 = 21^2 is square, so 457 is a term of the sequence.
2939 is prime and 2939 - (2+9+3+9) = 2916 = 54^2 is square, so 2939 is a term of the sequence.
101 is prime and 101 - (1+0+1) = 99 is not square, so 101 is not a term of the sequence.
		

Crossrefs

Intersection of A000040 and A066566.

Programs

  • Maple
    select(t -> isprime(t) and issqr(t - convert(convert(t,base,10),`+`)),
    [2,seq(i,i=3..20000,2)]); # Robert Israel, Apr 15 2019
  • Mathematica
    Select[Prime@ Range@ 2000, IntegerQ@ Sqrt[# - Total@ IntegerDigits@ #] &] (* Michael De Vlieger, Nov 05 2018 *)
  • PARI
    isok(p) = isprime(p) && issquare(p-sumdigits(p)); \\ Michel Marcus, Oct 30 2018

Extensions

a(26) corrected by Robert Israel, Apr 15 2019

A274368 Numbers k such that if k is decreased by the sum of its digits and k is decreased by the product of its digits both differences are squares > 0.

Original entry on oeis.org

45, 48, 231, 121116, 159229, 11985489, 17514256, 51624256, 88172137, 228523729, 467597425, 11112111412, 4329279198937, 3716589421762641, 23228676113127556, 138417183479417732388
Offset: 1

Views

Author

Pieter Post, Jun 19 2016

Keywords

Comments

It appears that if k is increased by the sum of its digits and k is increased by the product of its digits no two squares are found, except for the trivial k = 2 and k = 8.
The smallest k>8 such that k+A007953(k) and k+A007954(k) are both squares is k = 6469753431969. If a fourth such k exists, it must be larger than 1.6*10^19. - Giovanni Resta, Jun 19 2016

Examples

			45 - (4 + 5) = 36 and 45 - (4 * 5) = 25.
159229 - (1 + 5 + 9 + 2 + 2 + 9) = 157609 (= 397^2) and 159229 - (1*5*9*2*2*9) = 159201 (= 399^2).
From _David A. Corneth_, May 27 2021: (Start)
If the digits of a(n) = x are an anagram of 122599 then the product of digits is 1 * 2 * 2 * 5 * 9 * 9 = 1620 and the sum of digits is 1 + 2 + 2 + 5 + 9 + 9 = 28 as order of addition and multiplication does not matter. So x - 31 = m^2 and x - 1620 = k^2 for some positive integers k and m.
So m^2 - k^2 = (x - 28) - (x - 1620) = 1592 = (m - k)*(m + k). The divisors of 1592 are 1, 2, 4, 8, 199, 398, 796, 1592. Testing possible pairs m-k and m+k gives, among other pairs, (m - k, m + k) = (2, 796). Solving for k gives k = 397 so x = k^2 + 1620 = 397^2 + 1620 = 159229 giving an extra term. (End)
		

Crossrefs

Intersection of A066566 and A228187.

Programs

  • Mathematica
    lim = 10^6; s = Select[Range@ lim, IntegerQ@ # && # != 0 &@ Sqrt[# - Times @@ IntegerDigits@ #] &]; t = Select[Range@ lim, IntegerQ@ # && # != 0 &@ Sqrt[# - Total@ IntegerDigits@ #] &]; Intersection[s, t] (* Michael De Vlieger, Jun 19 2016 *)
  • PARI
    a007953(n) = sumdigits(n)
    a007954(n) = my(d=digits(n)); prod(i=1, #d, d[i])
    is(n) = n > 9 && issquare(n-a007953(n)) && issquare(n-a007954(n)) \\ Felix Fröhlich, Jun 19 2016
  • Python
    def pod(n):
        p = 1
        for x in str(n):
            p *= int(x)
        return p
    def sod(n):
        return sum(int(d) for d in str(n))
    def cube(z,p):
        iscube=False
        y=int(pow(z,1/p)+0.01)
        if y**p==z:
            iscube=True
        return iscube
    for c in range(1, 10**8):
        aa,ab=c-pod(c),c-sod(c)
        if cube(aa,2) and cube(ab,2) and aa>0:
           print(c,aa,ab)
    

Extensions

a(10)-a(15) from Giovanni Resta, Jun 19 2016
a(16) from David A. Corneth, May 27 2021
Showing 1-4 of 4 results.