cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A343727 Numbers with all digits odd whose squares have only one odd digit.

This page as a plain text file.
%I A343727 #33 Mar 20 2022 14:24:56
%S A343727 1,3,5,7,9,15,17,51,53,79,91,93,151,155,157,533,535,775,779,793,917,
%T A343727 1557,1571,1575,5179,5333,5335,7759,7799,9317,9393,9395,15557,15559,
%U A343727 15755,51595,53179,53333,53335,77759,79151,79175,93917,151151,155135,155191
%N A343727 Numbers with all digits odd whose squares have only one odd digit.
%C A343727 Of course, the one odd digit in the square is always the last digit.
%C A343727 The sequence is infinite because it contains the family of numbers 5, 53, 533, 5333, ....... with squares 25, 2809, 284089, 28440889, 2844408889. .... and respectively 535, 5335, 53335, ... with squares 286225, 28462225, 2844622225, 284446222225, ... - _Marius A. Burtea_, May 21 2021
%e A343727 53179 is a term: all its digits are odd, and 53179^2 = 2828006041 has only one odd digit.
%e A343727 15113133375599 is a term: all its digits are odd, and 15113133375599^2 = 228406800428644424408608801 has only one odd digit.
%t A343727 Select[Range[160000], AllTrue[IntegerDigits[#], OddQ] && AllTrue[Most @ IntegerDigits[#^2], EvenQ] &] (* _Amiram Eldar_, May 20 2021 *)
%o A343727 (Python)
%o A343727 def ok(n):
%o A343727   r, s = str(n), str(n*n)
%o A343727   return all(d in "13579" for d in r) and all(d in "02468" for d in s[:-1])
%o A343727 print(list(filter(ok, range(1, 155192, 2)))) # _Michael S. Branicky_, May 20 2021
%o A343727 (Python)
%o A343727 from itertools import product
%o A343727 A343727_list = [n for n in (int(''.join(d)) for l in range(1,6) for d in product('13579',repeat=l)) if set(str(n**2)[:-1]) <= set('02468')] # _Chai Wah Wu_, May 21 2021
%o A343727 (Magma) [n:n in [1..160000 by 2]|Set(Intseq(n)) subset {1,3,5,7,9} and Set(Intseq(n*n div 10)) subset {0,2,4,6,8}]; // _Marius A. Burtea_, May 21 2021
%Y A343727 Cf. A014261, A030098, A343726, A343728.
%K A343727 nonn,base
%O A343727 1,2
%A A343727 _Jon E. Schoenfield_, May 20 2021