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: Jim Singh

Jim Singh's wiki page.

Jim Singh has authored 5 sequences.

A320277 A digitized pure tuning tone, sampled at standard settings for consumer audio: a(n) = floor(sin(2*Pi*(440/44100)*n)*32767).

Original entry on oeis.org

0, 2052, 4097, 6126, 8130, 10103, 12036, 13921, 15752, 17521, 19222, 20846, 22389, 23844, 25205, 26467, 27625, 28675, 29612, 30433, 31134, 31713, 32167, 32494, 32695, 32766, 32709, 32524, 32210, 31770, 31206, 30518, 29711, 28787, 27750, 26604, 25354, 24004, 22559, 21026, 19410
Offset: 0

Author

Jim Singh, Oct 08 2018

Keywords

Comments

This sequence represents sample values for the simplest sound: a pure tone with no harmonics (i.e., a sine wave) with 0 phase shift, of digital peak amplitude, pitched at the standard tuning frequency (A440), and sampled at the standard sampling rate and bit depth resolution for consumer audio: 44100 Hz and 16 bits, respectively.
Since the maximum signed integer value that can be stored in 16 bits is (2^15)-1=32767, the method used to convert the floats to integers is to multiply the floats by 32767 then cast to integer.
The numerator and the denominator of the g.f. have degrees respectively equal to 2204 and 2205. - Stefano Spezia, Nov 02 2018

References

  • A. Davison, Killer Game Programming in Java, O'Reilly Media, 2005, page 254.

Programs

  • Mathematica
    a[n_]:= Floor[Sin[2*Pi*(440/44100)*n]*32767]; Array[a, 50, 0] (* Stefano Spezia, Nov 02 2018 *)
  • Python
    import math
    for x in range(100):
        floatval = math.sin(2*math.pi*(440/44100)*x)*32767
        intval = int(floatval)
        print(intval, end=', ')

A320170 Every pair of consecutive numbers sums to a palindrome, starting with a(0)=1; a(1)=10, and taking a(n) = smallest number > a(n-2).

Original entry on oeis.org

1, 10, 12, 21, 23, 32, 34, 43, 45, 54, 47, 64, 57, 74, 67, 84, 77, 94, 87, 104, 98, 114, 108, 124, 118, 134, 128, 144, 138, 154, 149, 164, 159, 174, 169, 184, 179, 194, 189, 204, 200, 214, 210, 224, 220, 234, 230, 244, 240, 254, 251, 264, 261, 274, 271
Offset: 0

Author

Jim Singh, Oct 07 2018

Keywords

Crossrefs

Cf. A062932.
For n < 10, equals A061870 and A175885.

Programs

  • Mathematica
    Nest[Append[#, Block[{k = #[[-2]] + 1}, While[! PalindromeQ[#[[-1]] + k], k++]; k]] &, {1, 10}, 53] (* Michael De Vlieger, Oct 10 2018 *)
  • Python
    CurrentNum=10
    PreviousNum=1
    NewNum=0
    def NextPalindrome(StartNum):
        FoundNext=0
        t=0
        n=0
        Number=0
        Lastdigit=0
        while FoundNext<=PreviousNum:
            n=n+1
            t=StartNum+n
            Number=t
            Reverse=0
            while Number>0:
                Lastdigit=Number%10
                Reverse=(Reverse*10)+Lastdigit
                Number=Number//10
            if t==Reverse:
                FoundNext=n
        return n
    print(1)
    print(10)
    for x in range(50):
        NewNum=NextPalindrome(CurrentNum)
        print(NewNum)
        PreviousNum=CurrentNum
        CurrentNum=NewNum

A319795 a(n) = n^(n+1)/(n-1)^n for n>1, rounded to nearest integer.

Original entry on oeis.org

8, 10, 13, 15, 18, 21, 23, 26, 29, 31, 34, 37, 40, 42, 45, 48, 50, 53, 56, 59, 61, 64, 67, 69, 72, 75, 78, 80, 83, 86, 88, 91, 94, 97, 99, 102, 105, 107, 110, 113, 116, 118, 121, 124, 126, 129, 132, 135, 137, 140, 143, 145, 148, 151, 154, 156, 159, 162, 164
Offset: 2

Author

Jim Singh, Sep 28 2018

Keywords

Crossrefs

Programs

  • Maple
    seq(round(n^(n+1)/(n-1)^n),n=1..100); # Muniru A Asiru, Sep 28 2018
  • PARI
    for(n=2,30,print1(round(n^(n+1)/(n-1)^n),","))

A319727 Rounded frequencies of notes in the shruti scale of Indian classical music, starting with 260.7 Hertz for C-equivalent note.

Original entry on oeis.org

261, 275, 278, 290, 293, 309, 313, 326, 330, 348, 352, 367, 371, 391, 412, 417, 435, 440, 464, 469, 489, 495, 521, 549, 556, 579, 587, 618, 626, 652, 660, 695, 704, 733, 743, 782, 824, 834, 869, 880, 927, 939, 978, 990
Offset: 1

Author

Jim Singh, Sep 26 2018

Keywords

Comments

A shruti can be interpreted as the smallest interval of pitch the ear can detect and a singer or musical instrument can produce, and accordingly the 'Grama' system divides an octave into 22 parts.
The scale involves 256/243, 25/24 and 81/80 as fractions.
Note that ((81/80)^10) * ((256/243)^7) * ((25/24)^5) = 2.
The frequencies correspond to the ratios [1/1, 256/243, 16/15, 10/9, 9/8, 32/27, 6/5, 5/4, 81/64, 4/3, 27/20, 45/32, 729/512, 3/2, 128/81, 8/5, 5/3, 27/16, 16/9, 9/5, 15/8, 243/128, 2/1].
The start is A-equivalent note = 440 Hz. The initial term (rounded frequency of C-equivalent note) is calculated as (16/27) * 440 Hz = 260.7 Hz.

Crossrefs

Programs

  • PARI
    Ratios={[1/1, 256/243, 16/15, 10/9, 9/8, 32/27, 6/5, 5/4, 81/64, 4/3, 27/20, 45/32, 729/512, 3/2, 128/81, 8/5, 5/3, 27/16, 16/9, 9/5, 15/8, 243/128];}
    a(n)={n--; round(440*16/27*2^(n\22)*Ratios[n%22+1])} \\ Andrew Howroyd, Sep 27 2018

A316742 Stepping through the Mersenne sequence (A000225) one step back, two steps forward.

Original entry on oeis.org

1, 0, 3, 1, 7, 3, 15, 7, 31, 15, 63, 31, 127, 63, 255, 127, 511, 255, 1023, 511, 2047, 1023, 4095, 2047, 8191, 4095, 16383, 8191, 32767, 16383, 65535, 32767, 131071, 65535, 262143, 131071, 524287, 262143, 1048575, 524287, 2097151, 1048575, 4194303, 2097151, 8388607, 4194303
Offset: 0

Author

Jim Singh, Jul 12 2018

Keywords

Examples

			Let 1. The first four terms are 1, (1-1)/2 = 0, 2*1+1 = 3, 1.
Let 4*1+3 = 7. The next four terms are 7, (7-1)/2 = 3, 2*7+1 = 15, 7.
Let 4*7+3 = 31. The next four terms are 31, (31-1)/2 = 15, 2*31+1 = 63, 31; etc.
		

Crossrefs

Programs

  • GAP
    a:=[1,0,3];; for n in [4..45] do a[n]:=a[n-1]+2*a[n-2]-2*a[n-3]; od; a; # Muniru A Asiru, Jul 14 2018
  • Maple
    seq(coeff(series((1-x+x^2)/((1-x)*(1-2*x^2)), x,n+1),x,n),n=0..45); # Muniru A Asiru, Jul 14 2018
  • Mathematica
    CoefficientList[Series[(1 - x + x^2)/((1 - x) (1 - 2 x^2)), {x, 0, 42}], x] (* Michael De Vlieger, Jul 13 2018 *)
    LinearRecurrence[{1, 2, -2}, {1, 0, 3}, 46] (* Robert G. Wilson v, Jul 21 2018 *)

Formula

a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) for n>2, a(0)=1, a(1)=0, a(2)=3.
From Bruno Berselli, Jul 12 2018: (Start)
G.f.: (1 - x + x^2)/((1 - x)*(1 - 2*x^2)).
a(n) = 2*a(n-2) + 1 for n>1, a(0)=1, a(1)=0.
a(n) = (1 + (-1)^n)*(2^(n/2) - 2^((n-3)/2)) + 2^((n-1)/2) - 1.
Therefore: a(4*k) = 2*4^k - 1, a(4*k+1) = 4^k - 1, a(4*k+2) = 4^(k+1) - 1, a(4*k+3) = 2*4^k - 1. (End)