A165137
a(n) is the number of patterns for n-character papaya words in an infinite alphabet.
Original entry on oeis.org
1, 1, 2, 4, 10, 21, 50, 99, 250, 454, 1242, 2223, 6394, 11389, 35002, 62034, 202010, 359483, 1233518, 2203507, 7944110, 14249736, 53811584, 96912709, 382289362, 691110821, 2841057442, 5154280744, 22033974854, 40105797777, 177946445580
Offset: 0
There are two types of two-digit papaya numbers: aa, or ab. Hence a(2) = 2. There are four types of three-digit papaya numbers: aaa, aab, aba, abb. Hence a(3) = 4.
-
R[k_?EvenQ] := (1/2)*k*(BellB[1 + k/2] + BellB[k/2]);
R[k_?OddQ] := k*BellB[1 + (k - 1)/2];
a[0] = 1; a[n_] := a[n] = R[n] - Sum[EulerPhi[n/d]*a[d], {d, Most[Divisors[ n]]}];
Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Oct 08 2017, after Andrew Howroyd *)
-
from functools import lru_cache
from sympy import bell, totient, proper_divisors
@lru_cache(maxsize=None)
def A165137(n): return (n*bell((n>>1)+1) if n&1 else (a:=n>>1)*(bell(a)+bell(a+1)))-sum(totient(n//d)*A165137(d) for d in proper_divisors(n,generator=True)) if n else 1 # Chai Wah Wu, Feb 19 2024
A165135
The number of n-digit positive papaya numbers.
Original entry on oeis.org
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
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.
-
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
-
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
A165610
The number of patterns of non-papaya words.
Original entry on oeis.org
0, 0, 1, 5, 31, 153, 778, 3890, 20693, 114733, 676347, 4207203, 27633048, 190864320, 1382896511, 10479940137, 82864510321, 682075572641, 5832740001550, 51724150291262, 474869801907015, 4506715684635739, 44152005758171637, 445958868912515927, 4638590331538888532
Offset: 1
The only three-character non-papaya pattern is abc - words with all distinct letters. Four-character non-papaya patterns are: aabc, abbc, abcc, abca, abcd.
-
R[k_?EvenQ] := (1/2)*k*(BellB[1 + k/2] + BellB[k/2]);
R[k_?OddQ] := k*BellB[1 + (k - 1)/2];
b[0] = 1; b[n_] := b[n] = R[n] - Sum[EulerPhi[n/d]*b[d], {d, Most[ Divisors[n]]}];
a[n_] := BellB[n] - b[n];
Array[a, 25] (* Jean-François Alcover, Jul 02 2018, after Andrew Howroyd *)
A165136
a(n) is the number of patterns for n-digit papaya numbers.
Original entry on oeis.org
1, 2, 4, 10, 21, 50, 99, 250, 454, 1242, 2223, 6394, 11389, 35002, 62034, 202010, 359483, 1233518, 2203507, 7944100, 14249715, 53810836, 96911168, 382258438, 691048071, 2840120987, 5152403569, 22010733048, 40059670261, 177444599715
Offset: 1
There are two types of two-digit papaya numbers: aa, or ab. Hence a(2) = 2.
There are four types of three-digit papaya numbers: aaa, aab, aba, abb. Hence a(3) = 4.
There is no pattern of the form "abcdefghijkl" contributing to a(12), because this requires 12 different letters in the alphabet, and the standard numbers alphabet provides only ten different digits 0-9.
Keyword:base added, comment expanded -
R. J. Mathar, Aug 29 2010
Showing 1-4 of 4 results.
Comments