login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A216391
Number of values of k for which phi(k) is a permutation of decimal digits of k, for k < 2^n.
1
1, 1, 1, 1, 2, 3, 3, 3, 5, 5, 5, 8, 19, 21, 34, 55, 81, 130, 221, 407, 515, 850, 1787, 2287, 3968, 8176, 12332, 18560, 36832, 71375, 94015, 173754
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