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!)
A137119 Numbers k such that k and k^2 use only the digits 2, 6, 7 and 9. 0
26, 27, 277, 269777 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Generated with DrScheme.
No further terms up to 2*10^27. - Robert Israel, Oct 04 2019
LINKS
EXAMPLE
269777^2 = 72779629729.
MAPLE
Extend:= proc(x, d)
local i;
op(select(t -> member(floor(t^2/10^(d)) mod 10, {2, 6, 7, 9}), [seq(i*10^d+x, i=[2, 6, 7, 9])]))
end proc:
R[0]:= {6, 7}:
for m from 1 to 10 do R[m]:= map(Extend, R[m-1], m) od:
{seq(op(select(t -> convert(convert(t^2, base, 10), set) subset {2, 6, 7, 9}, R[m])), m=0..10)}; # Robert Israel, Oct 04 2019
PROG
(Magma) [k:k in [1..10^6]| Set(Intseq(k)) join Set(Intseq(k^2)) subset {2, 6, 7, 9}]; // Marius A. Burtea, Oct 04 2019
(Python)
def test(n):
while n > 0:
d, n = n%10, n//10
if d == 0 or d == 1 or d == 3 or d == 4 or d == 5 or d == 8:
return 0
return 1
n, a = 0, 1
while n >= 0:
if test(a) and test(a*a):
n = n+1
print(n, a)
a = a+1 # A.H.M. Smeets, Oct 05 2019
CROSSREFS
Sequence in context: A136923 A042394 A137118 * A042396 A042398 A042400
KEYWORD
nonn,base,more
AUTHOR
Jonathan Wellons (wellons(AT)gmail.com), Jan 22 2008
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 25 07:07 EDT 2024. Contains 371964 sequences. (Running on oeis4.)