OFFSET
1,5
COMMENTS
Partial sums of A216394.
FORMULA
a(n) = # { k in A115921 | k < 2^n }. - M. F. Hasler, Feb 24 2014
EXAMPLE
a(12) = 8 because the values of k satisfying the condition for k < 2^12 are {1, 21, 63, 291, 502, 2518, 2817, 2991}. - V. Raman, Feb 18 2014
MAPLE
A216391 := proc(n)
local a, k, kdgs, pdgs ;
a := 0 ;
for k from 1 to 2^n do
kdgs := sort(convert(k, base, 10)) ;
numtheory[phi](k) ;
pdgs := sort(convert(%, base, 10)) ;
if pdgs = kdgs then
a := a+1 ;
end if;
end do:
a ;
end proc:
for n from 1 do
print(A216391(n)) ;
end do: # R. J. Mathar, Mar 04 2014
PROG
(PARI) a(n)=sum(k=1, 2^n, vecsort(digits(k)) == vecsort(digits(eulerphi(k)))) \\ V. Raman, Feb 18 2014, edited by M. F. Hasler, Mar 04 2014
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
V. Raman, Sep 06 2012
EXTENSIONS
a(28)-a(32) from Amiram Eldar, Nov 09 2024
STATUS
approved