A238712 Numbers in which squares may end (in base 10).
0, 1, 4, 5, 6, 9, 16, 21, 24, 25, 29, 36, 41, 44, 49, 56, 61, 64, 69, 76, 81, 84, 89, 96, 100, 104, 116, 121, 124, 129, 136, 144, 156, 161, 164, 169, 176, 184, 196, 201, 204, 209, 216, 224, 225, 236, 241, 244, 249, 256, 264, 276, 281, 284, 289, 296, 304
Offset: 1
Examples
6 is in the sequence because 4^2 = 16 ends in the digit 6. 7 is not in the sequence because no square can end with the digit 7.
Links
- Derek Orr, Table of n, a(n) for n = 1..9306
Programs
-
Mathematica
mx = 3; t = Union@ Table[ Mod[n^2, 10^mx], {n, 10^mx/2}]; t = Union@ Flatten@ Table[ Mod[t, 10^m], {m, mx}] (* Robert G. Wilson v, Sep 04 2014 *)
-
PARI
a=[];for(m=1,3,a=setunion(a,Set(vector(10^m,n,n^2)%10^m)));a
Formula
If n is present so is n^2. - Robert G. Wilson v, Sep 04 2014
Comments