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
Andrew Howroyd, Table of n, a(n) for n = 1..200
Tanya Khovanova, Papaya Words and Numbers
FORMULA
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