login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A343728 Numbers with all digits even whose squares have all but one digit odd. 2
0, 2, 4, 6, 24, 44, 86, 244, 424, 444, 846, 2444, 4424, 6286, 42424, 44244, 240244, 244086, 244866, 268286, 420846, 442244, 446286, 628646, 880646, 2402444, 4402044, 4442244, 8448666, 24040244, 24064866, 26682086, 26682866, 26828666, 28244244, 42400424 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Of course, the one even digit in the square is always the last digit.

LINKS

Chai Wah Wu, Table of n, a(n) for n = 1..100

EXAMPLE

244086 is a term: all its digits are even, and 244086^2 = 59577975396 has all but one digit odd.

244044086 is a term: all its digits are even, and 244044086^2 = 59557515911575396 has all but one digit odd.

MATHEMATICA

Select[Range[0, 10^6], AllTrue[IntegerDigits[#], EvenQ] && AllTrue[Most @ IntegerDigits[#^2], OddQ] &] (* Amiram Eldar, May 20 2021 *)

PROG

(Python)

def ok(n):

  r, s = str(n), str(n*n)

  return all(d in "02468" for d in r) and all(d in "13579" for d in s[:-1])

print(list(filter(ok, range(0, 42400425, 2)))) # Michael S. Branicky, May 20 2021

(Python)

from gmpy2 import digits

A343728_list = [n for n in (2*int(digits(d, 5)) for d in range(10**6)) if set(str(n**2)[:-1]) <= set('13579')] # Chai Wah Wu, May 21 2021

CROSSREFS

Cf. A014263, A030098, A343727.

Sequence in context: A261832 A141526 A226169 * A261746 A319575 A318609

Adjacent sequences:  A343725 A343726 A343727 * A343729 A343730 A343731

KEYWORD

nonn,base

AUTHOR

Jon E. Schoenfield, May 20 2021

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 5 08:27 EDT 2021. Contains 346464 sequences. (Running on oeis4.)