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.

A216391 Number of values of k for which phi(k) is a permutation of decimal digits of k, for k < 2^n.

Original entry on oeis.org

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

Views

Author

V. Raman, Sep 06 2012

Keywords

Comments

Partial sums of A216394.

Examples

			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
		

Crossrefs

Programs

  • 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
  • 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

Formula

a(n) = # { k in A115921 | k < 2^n }. - M. F. Hasler, Feb 24 2014

Extensions

a(28)-a(32) from Amiram Eldar, Nov 09 2024