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.

User: Thomas Quirk

Thomas Quirk's wiki page.

Thomas Quirk has authored 2 sequences.

A204692 a(n) is the number of base-10 bouncy numbers below 10^n.

Original entry on oeis.org

0, 0, 525, 8325, 95046, 987048, 9969183, 99932013, 999859093, 9999722967, 99999479435, 999999059545, 9999998358645, 99999997221695, 999999995423887, 9999999992645451, 99999999988439336, 999999999982190246, 9999999999973063281, 99999999999959940181, 999999999999941340896
Offset: 1

Author

Thomas Quirk, Jan 18 2012

Keywords

Comments

A bouncy number has digits that are neither monotonically increasing nor decreasing from left to right.

Examples

			a(3) = 525 because there are 525 base-10 bouncy numbers < 10^3; the smallest is A152054(1) = 101 and the largest one is A152054(525) = 989.
a(4) = 8325 because A152054(8325) = 9989 is the largest base-10 bouncy number < 10^4.
		

Crossrefs

Cf. A152054.

Programs

  • GAP
    a:=[0,0];; for n in [3..25] do a[n]:=10^n-(Binomial(n+10,10)+Binomial(n+9,9)-1-10*n); od; a; # Muniru A Asiru, Sep 28 2018
    
  • Magma
    [n le 2 select 0 else (10^n - Binomial(n+10, 10) - Binomial(n+9, 9) + 10*n + 1): n in [1..25]]; // G. C. Greubel, Nov 24 2018
    
  • Maple
    a:=n->`if`(n<=2,0,10^n-(binomial(n+10,10)+binomial(n+9,9)-1-10*n)); seq(a(n),n=1..25); # Muniru A Asiru, Sep 28 2018
  • Mathematica
    a[n_]:= 10^n - Binomial[n+10, 10] - Binomial[n+9, 9] + 10*n + 1; Array[a, 25] (* Stefano Spezia, Sep 29 2018 *)
  • PARI
    a(n) = if(n<3, 0, 10^n-(binomial(n+10,10)+binomial(n+9, 9)-1-10*n)); \\ Altug Alkan, Sep 27 2018
    
  • Sage
    def A204692(n):
        if n <= 2:
            return 0
        else:
            return (10^n - binomial(n+10, 10) - binomial(n+9, 9) + 10*n + 1)
    [A204692(n) for n in (1..25)] # G. C. Greubel, Nov 24 2018

Formula

a(1) = a(2) = 0. For n > 2, a(n) = 10^n - binomial(n+9, n) + 10*n - Sum_{i=1..n} binomial(i+9, i) = 10^n - binomial(n+10, 10) - binomial(n+9, 9) + 10*n + 1. [Corrected by Altug Alkan, Sep 28 2018]
From Chai Wah Wu, Jul 28 2023: (Start)
a(n) = 21*a(n-1) - 165*a(n-2) + 715*a(n-3) - 1980*a(n-4) + 3762*a(n-5) - 5082*a(n-6) + 4950*a(n-7) - 3465*a(n-8) + 1705*a(n-9) - 561*a(n-10) + 111*a(n-11) - 10*a(n-12) for n > 12.
G.f.: x^3*(89*x^8 - 798*x^7 + 3175*x^6 - 7350*x^5 + 10890*x^4 - 10668*x^3 + 6846*x^2 - 2700*x + 525)/((x - 1)^11*(10*x - 1)). (End)

Extensions

Corrected and extended by Altug Alkan, Sep 27 2018

A176974 First exponent n to generate maximum remainder when (a + 1)^n + (a - 1)^n is divided by a^2 for variable n and a>2.

Original entry on oeis.org

1, 1, 7, 5, 3, 3, 13, 9, 5, 5, 19, 13, 7, 7, 25, 17, 9, 9, 31, 21, 11, 11, 37, 25, 13, 13, 43, 29, 15, 15, 49, 33, 17, 17, 55, 37, 19, 19, 61, 41, 21, 21, 67, 45, 23, 23, 73, 49, 25, 25, 79, 53, 27, 27, 85, 57, 29, 29, 91, 61, 31, 31, 97, 65, 33, 33, 103, 69
Offset: 3

Author

Thomas Quirk, Apr 29 2010

Keywords

Crossrefs

Cf. A159469.

Programs

  • PARI
    Vec(x^3*(1 + x + 7*x^2 + 5*x^3 + x^4 + x^5 - x^6 - x^7) / ((1 - x)^2*(1 + x)^2*(1 + x^2)^2) + O(x^100)) \\ Colin Barker, Oct 29 2017

Formula

From Colin Barker, Oct 29 2017: (Start)
G.f.: x^3*(1 + x + 7*x^2 + 5*x^3 + x^4 + x^5 - x^6 - x^7) / ((1 - x)^2*(1 + x)^2*(1 + x^2)^2).
a(n) = 2*a(n-4) - a(n-8) for n>10.
(End)

Extensions

Corrected and extended by Ray Chandler, Oct 16 2011