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.

Showing 1-4 of 4 results.

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

Views

Author

Sergei Bernstein and Tanya Khovanova, Sep 04 2009

Keywords

Comments

Papaya words are concatenations of two palindromes or palindromes themselves. A165136 is the number of papaya patterns for n-digit numbers. Thus a(n) coincides with A165136 for small n, and is greater than A165136 for larger n. The actual number of n-digit papaya numbers is A165135.
The first 19 terms of this sequence are the same as in A165136. A165137(20) = A165136(20)+10. - Tanya Khovanova, Oct 01 2009, corrected by Franklin T. Adams-Watters, Apr 10 2011

Examples

			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.
		

Crossrefs

Programs

  • Mathematica
    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 *)
  • Python
    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

Formula

a(n) = R(n) - Sum_{d|n,dA000110(k). - Andrew Howroyd, Mar 29 2016

Extensions

a(0) and a(7)-a(14) from Franklin T. Adams-Watters, Apr 10 2011
a(15)-a(30) from Andrew Howroyd, Mar 29 2016

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

Views

Author

Sergei Bernstein and Tanya Khovanova, Sep 04 2009

Keywords

Comments

Papaya numbers are concatenations of two palindromes or palindromes themselves. All one-digit and two-digit numbers are papaya numbers.

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.
		

Crossrefs

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) = A052268(n)-A165611(n). - R. J. Mathar, Sep 25 2009
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

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

Views

Author

Tanya Khovanova, Sep 22 2009

Keywords

Comments

Papaya words are defined as palindromes or concatenations of two palindromes.

Examples

			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.
		

Crossrefs

Programs

  • Mathematica
    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 *)

Formula

a(n) = A000110(n) - A165137(n).

Extensions

a(7)-a(25) from Andrew Howroyd, Mar 29 2016

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

Views

Author

Sergei Bernstein and Tanya Khovanova, Sep 04 2009

Keywords

Comments

Papaya numbers are concatenations of two palindromes or palindromes themselves (think of "papaya" as the concatenation of the palindromes "pap" and "aya").
The actual number of n-digit papaya numbers is A165135. If the pattern is "aa", for example, inserting digits 1 to 9 for "a" gives 9 positive 2-digit numbers, 11, 22, ..., 99. The pattern "ab" inserting a<>b gives 10, 12, ..., 98, that is 9*9 = 81 positive 2-digit numbers. (9 different choices for "a" because leading 0's are not allowed, and for each "a" 9 different choices of "b".) So the a(2) = 2 different patterns represent 9+81 = A165135(2) different 2-digit numbers.
The first 19 terms of this sequence are the same as in A165137. Then the sequences start to differ, because the number of patterns in an infinite alphabet can be larger than patterns in the 10-digits-alphabet of ordinary numbers: A165137(20) = a(20)+10. - Tanya Khovanova, Oct 01 2009 (Since at most 2 symbols in a papaya number can be present only once, to require 11 symbols takes a length of 2 + (11-2)*2 = 20. The 10 strings for A165137(20) not counted here are abcdefghijkjihgfedbc, abacdefghijkjihgfedc, abcbadefghijkjihgfed, ..., abcdefghijihgfedcbak. - Franklin T. Adams-Watters, Apr 10 2011)

Examples

			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.
		

Crossrefs

Formula

a(n) = R(n) - Sum_{d|n,dAndrew Howroyd, Mar 29 2016

Extensions

Three more terms from R. J. Mathar, Sep 25 2009
Keyword:base added, comment expanded - R. J. Mathar, Aug 29 2010
a(10)-a(14) from Franklin T. Adams-Watters, Apr 10 2011
a(15)-a(30) from Andrew Howroyd, Mar 29 2016
Showing 1-4 of 4 results.