login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A224955 Numbers that are not squares, but can become squares by prepending or appending one additional digit. 1
2, 3, 5, 6, 8, 10, 12, 14, 19, 21, 22, 24, 28, 29, 32, 40, 41, 44, 48, 52, 56, 57, 61, 62, 67, 69, 72, 76, 78, 84, 89, 90, 96, 102, 108, 115, 116, 122, 129, 136, 152, 156, 160, 168, 176, 184, 193, 202, 209, 211, 216, 220, 230, 240, 241, 249, 250, 260, 270, 280 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
There are potentially 15 ways for each number to become a square--by prepending a digit between 1 and 9, or appending one of {0,1,4,5,6,9}. However, only 74 of the first 10000 terms can become a square in more than one way.
LINKS
Christian N. K. Anderson, Table of n, a(n) for n = 1..10000
Christian N. K. Anderson, List of squares that can be formed by concatenating one digit to the first 10000 terms.
Christian N. K. Anderson, Ulam spiral of a(n), with brighter colors corresponding to the number of ways a term may become a square.
EXAMPLE
a(4)=6 because, though 6 is not a square, it can become a square by prepending a 1 to become 16. We can also obtain 36 and 64.
MAPLE
isA224955 := proc(n)
local p, ndgs;
if issqr(n) then
return false;
else
ndgs := convert(n, base, 10) ;
for p from 1 to 9 do
[op(ndgs), p] ;
add(op(i, %)*10^(i-1), i=1..nops(%)) ;
if issqr(%) then
return true;
end if;
end do:
for p in {0, 1, 4, 5, 6, 9} do
[p, op(ndgs)] ;
add(op(i, %)*10^(i-1), i=1..nops(%)) ;
if issqr(%) then
return true;
end if;
end do:
return false;
end if;
end proc:
n := 1;
c := 1;
while n <= 10000 do
if isA224955(c) then
printf("%d %d\n", n, c) ;
n := n+1 ;
end if;
c := c+1 ;
end do: # R. J. Mathar, Mar 14 2016
MATHEMATICA
Module[{nn=300, pre=Range[9], app={0, 1, 4, 5, 6, 9}}, Select[Range[nn], (!IntegerQ[ Sqrt[ #]]) && (AnyTrue[Sqrt[pre*10^IntegerLength[#]+#], IntegerQ] || AnyTrue[ Sqrt[ 10#+app], IntegerQ])&]] (* Harvey P. Dale, Feb 27 2022 *)
CROSSREFS
Sequence in context: A213857 A011864 A045919 * A006856 A249013 A211964
KEYWORD
nonn,base
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 06:44 EDT 2024. Contains 371782 sequences. (Running on oeis4.)