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.

A228187 Positive numbers which when decremented by the product of their digits produce a square.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 24, 37, 45, 48, 67, 71, 79, 100, 228, 231, 256, 259, 292, 388, 400, 524, 575, 624, 661, 832, 865, 868, 900, 928, 949, 973, 985, 1024, 1089, 1231, 1317, 1344, 1399, 1541, 1549, 1564, 1600, 1612, 1629, 1723, 1759, 2025, 2164, 2209
Offset: 1

Views

Author

Derek Orr, Aug 15 2013

Keywords

Examples

			388 is a term because 388-(3*8*8) = 196 = 14^2.
		

Crossrefs

Cf. A066567.

Programs

  • Maple
    a:= proc(n) option remember; local d, k, m;
          for k from 1+`if`(n=1, 0, a(n-1)) do
            d, m:= 1, k;
            while m>0 do d:=d*irem(m,10,'m') od;
            if issqr(k-d) then return k fi
          od
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Aug 19 2013
  • Mathematica
    Select[Range[2500],IntegerQ[Sqrt[#-Times@@IntegerDigits[#]]]&] (* Harvey P. Dale, Aug 16 2025 *)
  • PARI
    for(n=0,10^4,d=digits(n);p=prod(i=1,#d,d[i]);if(issquare(n-p),print(n,", "))) \\ Derek Orr, Mar 13 2015