Search: a348487 -id:a348487
|
|
A348488
|
|
Positive numbers whose square starts and ends with exactly one 4.
|
|
+0
5
|
|
|
2, 22, 68, 202, 208, 218, 222, 642, 648, 652, 658, 672, 678, 682, 692, 698, 702, 2002, 2008, 2018, 2022, 2028, 2032, 2042, 2048, 2052, 2058, 2068, 2072, 2078, 2082, 2092, 2122, 2128, 2132, 2142, 2148, 2152, 2158, 2168, 2172, 2178, 2182, 2192, 2198, 2202, 2208, 2218, 2222, 2228
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
When a square ends with 4 (A273375), this square may end with precisely one 4, two 4's or three 4's (A328886).
This sequence is infinite as each 2*(10^m + 1), m >= 1 or 2*(10^m + 4), m >= 2 is a term.
Numbers 2, 22, 222, ..., 2*(10^k - 1) / 9, (k >= 1), as well as numbers 2228, 22228, ..., 2*(10^k + 52) / 9, (k >= 4) are terms and have no digits 0. - Marius A. Burtea, Oct 24 2021
|
|
LINKS
|
|
|
EXAMPLE
|
22 is a term since 22^2 = 484.
638 is not a term since 638^2 = 407044.
668 is not a term since 668^2 = 446224.
|
|
MATHEMATICA
|
Join[{2}, Select[Range[10, 2000], (d = IntegerDigits[#^2])[[1]] == d[[-1]] == 4 && d[[-2]] != 4 && d[[2]] != 4 &]] (* Amiram Eldar, Oct 24 2021 *)
|
|
PROG
|
(PARI) isok(k) = my(d=digits(sqr(k))); (d[1]==4) && (d[#d]==4) && if (#d>2, (d[2]!=4) && (d[#d-1]!=4), 1); \\ Michel Marcus, Oct 24 2021
(Magma) [2] cat [n:n in [4..2300]|Intseq(n*n)[1] eq 4 and Intseq(n*n)[#Intseq(n*n)] eq 4 and Intseq(n*n)[-1+#Intseq(n*n)] ne 4 and Intseq(n*n)[2] ne 4]; // Marius A. Burtea, Oct 24 2021
(Python)
from itertools import count, takewhile
def ok(n):
s = str(n*n); return len(s.rstrip("4")) == len(s.lstrip("4")) == len(s)-1
def aupto(N):
r = takewhile(lambda x: x<=N, (10*i+d for i in count(0) for d in [2, 8]))
return [k for k in r if ok(k)]
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A348489
|
|
Positive numbers whose square starts and ends with exactly one 5.
|
|
+0
3
|
|
|
75, 225, 715, 725, 735, 755, 765, 2245, 2255, 2265, 2275, 2285, 2295, 2305, 2315, 2325, 2335, 2345, 2375, 2385, 2395, 2405, 2415, 2425, 2435, 2445, 7075, 7085, 7095, 7105, 7115, 7125, 7135, 7145, 7155, 7165, 7175, 7185, 7195, 7205, 7215, 7225, 7235, 7245
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
When a square ends with 5, it ends with 25.
Numbers 75, 765, 7665, 76665, ..., (23*10^k -5) / 3, k >= 1, are terms and have no digits 0, because their squares are 5625, 585225, 58752225, 5877522225, 587775222225, 58777752222225, ...
Also 75, 735, 7335, 73335, ..., (22*10^n+5) / 3, k >= 1, are terms and have no digits 0, because their squares are 5625, 540225, 53802225, 5378022225, 537780222225, 53777802222225, ... (End)
|
|
LINKS
|
|
|
EXAMPLE
|
75^2 = 5625, hence 75 is a term.
235^2 = 55225, hence 235 is not a term.
|
|
MATHEMATICA
|
Select[5 * Range[2, 1500], (d = IntegerDigits[#^2])[[1]] == d[[-1]] == 5 && d[[2]] != 5 &] (* Amiram Eldar, Oct 25 2021 *)
|
|
PROG
|
(PARI) isok(k) = my(d=digits(sqr(k))); (d[1]==5) && (d[#d]==5) && if (#d>2, (d[2]!=5) && (d[#d-1]!=5), 1); \\ Michel Marcus, Oct 25 2021
(Magma) [n:n in [4..7500]|Intseq(n*n)[1] eq 5 and Intseq(n*n)[#Intseq(n*n)] eq 5 and Intseq(n*n)[-1+#Intseq(n*n)] ne 5 ]; // Marius A. Burtea, Oct 25 2021
(Python)
from itertools import count, takewhile
def ok(n):
s = str(n*n); return len(s.rstrip("5")) == len(s.lstrip("5")) == len(s)-1
def aupto(N):
r = takewhile(lambda x: x<=N, (10*i+5 for i in count(0)))
return [k for k in r if ok(k)]
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A348490
|
|
Positive numbers whose square starts and ends with exactly one 6.
|
|
+0
3
|
|
|
26, 246, 254, 256, 264, 776, 784, 786, 794, 796, 804, 806, 824, 826, 834, 836, 2454, 2456, 2464, 2466, 2474, 2476, 2484, 2486, 2494, 2496, 2504, 2506, 2514, 2516, 2524, 2526, 2534, 2536, 2544, 2546, 2554, 2556, 2564, 2566, 2594, 2596, 2604, 2606, 2614, 2616, 2624, 2626, 2634, 2636, 2644, 7746
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
When a square ends with 6, it ends with only one 6.
The sequence is infinite because the numbers 806, 8006, 80006, ..., 8*10^k + 6, k >= 2, are terms with squares 649636, 64096036, 6400960036, 640009600036, ..., 64*10^(2*k) + 96*10^k + 36, k >= 2.
Numbers 796, 7996, 79996, 799996, 7999996, 79999996, ..., 10^k*8 - 4, k >= 2, are terms and have no digits 0, because their squares are 633616, 63936016, 6399360016, 639993600016, 63999936000016, 6399999360000016, ....
Also 794, 7994, 79994, 799994, ..., (8*10^k - 6), k >= 2, are terms and have no digits 0, because their squares are 630436, 63904036, 6399040036, 639990400036, 63999904000036, 6399999040000036, ... (End)
|
|
LINKS
|
|
|
EXAMPLE
|
26^2 = 676, hence 26 is a term.
814^2 = 662596, hence 814 is not a term.
|
|
MATHEMATICA
|
Select[Range[10, 7750], (d = IntegerDigits[#^2])[[1]] == d[[-1]] == 6 && d[[2]] != 6 &] (* Amiram Eldar, Oct 30 2021 *)
|
|
PROG
|
(Python)
from itertools import count, takewhile
def ok(n):
s = str(n*n); return len(s.rstrip("6")) == len(s.lstrip("6")) == len(s)-1
def aupto(N):
r = takewhile(lambda x: x<=N, (10*i+d for i in count(0) for d in [4, 6]))
return [k for k in r if ok(k)]
(PARI) isok(k) = my(d=digits(sqr(k))); (d[1]==6) && (d[#d]==6) && if (#d>2, (d[2]!=6) && (d[#d-1]!=6), 1); \\ Michel Marcus, Oct 30 2021
(Magma) [n:n in [4..7500]|Intseq(n*n)[1] eq 6 and Intseq(n*n)[#Intseq(n*n)] eq 6 and Intseq(n*n)[-1+#Intseq(n*n)] ne 6 ]; // Marius A. Burtea, Oct 30 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A348491
|
|
Positive numbers whose square starts and ends with exactly one 9.
|
|
+0
2
|
|
|
3, 97, 303, 307, 313, 953, 957, 963, 967, 973, 977, 983, 987, 993, 3003, 3007, 3013, 3017, 3023, 3027, 3033, 3037, 3043, 3047, 3053, 3057, 3063, 3067, 3073, 3077, 3083, 3087, 3093, 3097, 3103, 3107, 3113, 3117, 3123, 3127, 3133, 3137, 3143, 9487, 9493, 9497, 9503, 9507, 9513, 9517
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
When a square ends with 9, it ends with only one 9.
The sequence is infinite because the numbers 303, 3003, 30003, ..., 3*(10^k + 1), k >= 2, are terms with squares 91809, 9018009, 900180009, 90001800009, ... 9*(10^(2*k) + 2*10^k + 1), k >= 2.
Numbers 97, 967, 9667, 96667, 966667, ..., (29*10^n + 1) / 3, k >= 1, are terms and have no digits 0, because their squares are 9409, 935089, 93450889, 9344508889, 934445088889, ...
Also 963, 9663, 96663, 966663, 9666663, 96666663, ... (29*10^k - 11) / 3, k >= 2, are terms and have no digits 0, because their squares are 927369, 93373569, 9343735569, 934437355569, 93444373555569, 9344443735555569, ... (End)
|
|
LINKS
|
|
|
EXAMPLE
|
97^2 = 9409, hence 97 is a term.
997^2 = 994009, hence 997 is not a term.
|
|
MATHEMATICA
|
Join[{3}, Select[Range[10, 10^4], (d = IntegerDigits[#^2])[[1]] == d[[-1]] == 9 && d[[2]] != 9 &]] (* Amiram Eldar, Nov 02 2021 *)
|
|
PROG
|
(Magma) [3] cat [n:n in [4..9600]|Intseq(n*n)[1] eq 9 and Intseq(n*n)[#Intseq(n*n)] eq 9]; // Marius A. Burtea, Nov 02 2021
(Python)
from itertools import count, takewhile
def ok(n):
s = str(n*n); return len(s.rstrip("9")) == len(s.lstrip("9")) == len(s)-1
def aupto(N):
r = takewhile(lambda x: x<=N, (10*i+d for i in count(0) for d in [3, 7]))
return [k for k in r if ok(k)]
(PARI) isok(k) = my(d=digits(sqr(k))); (d[1]==9) && (d[#d]==9) && if (#d>2, (d[2]!=9) && (d[#d-1]!=9), 1); \\ Michel Marcus, Nov 03 2021
(PARI) list(lim)=my(v=List([3])); for(d=2, 2*#digits(lim\=1), my(s=sqrtint(9*10^(d-1)-1)+1); s+=[3, 2, 1, 0, 3, 2, 1, 0, 5, 4][s%10+1]; forstep(n=s, min(sqrtint(10^d-10^(d-2)-1), lim), if(s%10==3, [4, 6], [6, 4]), listput(v, n))); Vec(v) \\ Charles R Greathouse IV, Nov 03 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
Search completed in 0.007 seconds
|