login
A076164
Numbers k such that sum of squares of even digits of k equals sum of squares of odd digits.
2
0, 11112, 11121, 11211, 11356, 11365, 11536, 11563, 11635, 11653, 12111, 13156, 13165, 13516, 13561, 13615, 13651, 15136, 15163, 15316, 15361, 15613, 15631, 16135, 16153, 16315, 16351, 16513, 16531, 21111, 31156, 31165, 31516, 31561
OFFSET
1,2
COMMENTS
The minimal number of digits in any nonzero term is 5.
Numbers such that the sum of even digits equals the sum of odd digits are listed in A036301.
LINKS
EXAMPLE
11356 is in the sequence because 1^2 + 1^2 + 3^2 + 5^2 = 6^2.
MAPLE
filter:= proc(n) local t;
add(t^2*(-1)^(t+1), t=convert(n, base, 10))=0
end proc:
select(filter, [$0..10^5]); # Robert Israel, Mar 17 2026
MATHEMATICA
oeQ[n_]:=Module[{idn=IntegerDigits[n]}, Total[Select[idn, OddQ]^2]== Total[ Select[ idn, EvenQ]^2]]; Select[Range[0, 99999], oeQ] (* Harvey P. Dale, Sep 23 2011 *)
PROG
(PARI) is(n)=!vecsum(apply(d->d^2*(-1)^d, digits(n))) \\ M. F. Hasler, May 18 2018
(Python)
def ok(n):
d, s = list(map(int, str(n))), [0, 0]
for di in d: s[di&1] += di*di
return s[0] == s[1]
print([k for k in range(32000) if ok(k)]) # Michael S. Branicky, Mar 17 2026
CROSSREFS
Cf. A303269, A036301 (analog without squares), A071650, A304439, A304440, A124176, A124177.
Sequence in context: A262497 A291946 A154807 * A234661 A261778 A268278
KEYWORD
nonn,base
AUTHOR
Zak Seidov, Nov 01 2002
EXTENSIONS
Edited and a(1) = 0 added by M. F. Hasler, May 18 2018
STATUS
approved