login
A165135
The number of n-digit positive papaya numbers.
6
9, 90, 252, 1872, 4464, 29250, 62946, 393912, 809442, 4945140, 9899910, 59366286, 116999892, 692936460, 1349989992, 7919601912, 15299999856, 89099130960, 170999999838, 989995038012, 1889999872488, 10889990099100, 20699999999802, 118799939782206, 224999999981964
OFFSET
1,1
COMMENTS
Papaya numbers are concatenations of two palindromes or palindromes themselves. All one-digit and two-digit numbers are papaya numbers.
LINKS
FORMULA
a(n) = A052268(n)-A165611(n). - R. J. Mathar, Sep 25 2009
a(n) = 9*R(n,10)/10 - Sum_{d|n,d<n} phi(n/d)*a(d) where R(2*k,r)=k*(r+1)*r^k, R(2*k+1,r)=(2*k+1)*r^(k+1). - Andrew Howroyd, Mar 29 2016
EXAMPLE
Three-digit papaya numbers are of four types: aaa (total of 9) and aab, aba, abb, (total of 81 for each). Hence a(3) = 252.
PROG
(PARI)
R(n, b)=if(n%2==0, n/2*(b+1)*b^(n/2), n*b^((n+1)/2));
a(n) = 9*R(n, 10)/10 - sumdiv(n, d, if(n<>d, eulerphi(n/d)*a(d))); \\ Andrew Howroyd, Oct 14 2017
(Python)
from functools import lru_cache
from sympy import totient, proper_divisors
@lru_cache(maxsize=None)
def A165135(n): return 9*(n*10**(n>>1) if n&1 else 11*(a:=n>>1)*10**(a-1))-sum(totient(n//d)*A165135(d) for d in proper_divisors(n, generator=True)) # Chai Wah Wu, Feb 19 2024
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Sergei Bernstein and Tanya Khovanova, Sep 04 2009
EXTENSIONS
a(7)-a(8) from R. J. Mathar, Sep 25 2009
a(9)-a(25) from Andrew Howroyd, Mar 29 2016
STATUS
approved