A165135 The number of n-digit positive papaya numbers.
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
Examples
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.
Links
- Andrew Howroyd, Table of n, a(n) for n = 1..200
- Tanya Khovanova, Papaya Words and Numbers
Programs
-
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
Formula
a(n) = 9*R(n,10)/10 - Sum_{d|n,dAndrew Howroyd, Mar 29 2016
Extensions
a(7)-a(8) from R. J. Mathar, Sep 25 2009
a(9)-a(25) from Andrew Howroyd, Mar 29 2016
Comments