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: Shreevatsa R

Shreevatsa R's wiki page.

Shreevatsa R has authored 6 sequences.

A357677 Powers of either 3 or 5 or 7 (and 0).

Original entry on oeis.org

0, 1, 3, 5, 7, 9, 25, 27, 49, 81, 125, 243, 343, 625, 729, 2187, 2401, 3125, 6561, 15625, 16807, 19683, 59049, 78125, 117649, 177147, 390625, 531441, 823543, 1594323, 1953125, 4782969, 5764801, 9765625, 14348907, 40353607, 43046721, 48828125, 129140163
Offset: 1

Author

Shreevatsa R, Oct 08 2022

Keywords

Comments

Block groups in which copies of the superblock are stored, when the "sparse superblock feature" is enabled, in the ext2/ext3/ext4 filesystems. (That is, copies of the superblock are stored in every block group when the feature is disabled, or in block groups 0, 1, 3, 5, 7, 9, 25, ... when the feature is enabled.)

Crossrefs

Union of (0 and) A000244, A000351, A000420.

Programs

  • Mathematica
    With[{max = 1.3*10^8}, Sort @ Flatten @ Join[{0, 1}, Table[p^Range[1, Floor[Log[p, max]]], {p, {3, 5, 7}}]]] (* Amiram Eldar, Oct 09 2022 *)

A347291 Multiplicative function defined by a(p) = 2 and a(p^k) = p^(k-1) for k >= 2.

Original entry on oeis.org

1, 2, 2, 2, 2, 4, 2, 4, 3, 4, 2, 4, 2, 4, 4, 8, 2, 6, 2, 4, 4, 4, 2, 8, 5, 4, 9, 4, 2, 8, 2, 16, 4, 4, 4, 6, 2, 4, 4, 8, 2, 8, 2, 4, 6, 4, 2, 16, 7, 10, 4, 4, 2, 18, 4, 8, 4, 4, 2, 8, 2, 4, 6, 32, 4, 8, 2, 4, 4, 8, 2, 12, 2, 4, 10, 4, 4, 8, 2, 16, 27, 4, 2, 8, 4
Offset: 1

Author

Shreevatsa R, Jan 22 2022

Keywords

Comments

a(n) is the least number of distinct values mod n attained by a polynomial p(x) such that p(x) == 0 (mod n) if and only if x == 0 (mod n).

Examples

			For n = 8, a(8) = a(2^3) = 2^2 = 4. Also, any polynomial p(x) that is 0 only for x == 0 (mod 8) takes at least a(8)=4 distinct values. (The polynomial p(x) = x^3 + x is an example.)
When n is a prime number, the polynomial p(x) = x^(n-1), by Fermat's little theorem, is 0 (mod n) when x == 0 (mod n), and 1 (mod n) otherwise. So it takes only two distinct values, and a(p) = 2.
a(360) = a(2^3 * 3^2 * 5) = 2^2 * 3 * 2 = 24.
		

Programs

  • Mathematica
    f[p_, e_] := If[e == 1, 2, p^(e - 1)]; a[n_] := Times @@ f @@@ FactorInteger[n]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Jan 23 2022 *)
  • PARI
    a(n) = { my(f = factor(n)); for(i = 1, #f~, if(f[i, 2] == 1, f[i, 1] = 2; , f[i, 2]--; ) ); factorback(f) } \\ David A. Corneth, Jan 22 2022
  • Python
    from sympy import factorint, prod
    def a(n):
        return prod((2 if k == 1 else p**(k-1)) for (p, k) in factorint(n).items())
    

Formula

If n = p1^k1 p2^k2 ... pr^kr, then a(n) = a(p1^k1) a(p2^k2) ... a(pr^kr), where a(p^k) is 2 if k=1 and p^(k-1) if k>=2.
Dirichlet g.f.: zeta(s-1) * Product_{p prime} (1 - 1/p^(s-1) + 2/p^s - 1/p^(2*s-1)). - Amiram Eldar, Oct 01 2023

Extensions

Corrected and extended by David A. Corneth, Jan 22 2022

A323425 Number of ways n people in a line can each choose two others both on the same side of them.

Original entry on oeis.org

1, 0, 0, 0, 9, 648, 57600, 6615000, 972504225, 179499220992, 40789783609344, 11212877910528000, 3671848787797265625, 1413385410212064432000, 632129969391038455873536, 325176984737061807515098752, 190691488202627199302740850625, 126479088749202444199526400000000
Offset: 0

Author

Shreevatsa R, Jan 14 2019

Keywords

Examples

			Example: For n = 4, with four people ABCD, A can choose any two of {B, C, D} (3 choices), B can choose {C, D} (1 choice), C can choose {A, B} (1 choice), and D can choose any two of {A, B, C} (3 choices), so there are 3*1*1*3=9 possible overall choices and a(4) = 9.
Example: For n = 5, with five people ABCDE, A can choose any two of {B, C, D, E} (6 choices), B can choose any two of {C, D, E} (3 choices), C can choose either {A, B} or {D, E} (2 choices), D can choose any two of {A, B, C} (3 choices), E can choose any two of {A, B, C, D} (6 choices), so a(5) = 6*3*2*3*6 = 648.
		

Programs

  • Haskell
    a n = product [(k-1)*(k-2) `div` 2 + (n-k)*(n-k-1) `div` 2 | k<-[1..n]]
  • Mathematica
    Table[Product[Binomial[k-1, 2] + Binomial[n-k, 2], {k, 1, n}], {n, 0, 20}] (* Vaclav Kotesovec, Jan 15 2019 *)

Formula

a(n) = Product_{k = 1..n} ( binomial(k-1, 2) + binomial(n-k, 2) ).
a(n) ~ exp(Pi*(n/2 - 1) - 2*n) * n^(2*n) / 2^n. - Vaclav Kotesovec, Jan 15 2019

Extensions

More terms from Vaclav Kotesovec, Jan 15 2019

A260249 Month numbers in the Gregorian calendar, in alphabetical order of their English names.

Original entry on oeis.org

4, 8, 12, 2, 1, 7, 6, 3, 5, 11, 10, 9
Offset: 1

Author

Shreevatsa R, Jul 20 2015

Keywords

Examples

			In alphabetical order, the months of the Gregorian calendar are: April (4), August (8), December (12), February (2), January (1), July (7), June (6), March (3), May (5), November (11), October (10), September (9).
		

Crossrefs

Cf. A033986.

A227480 Triangular numbers of the form p^2 - 1 where p is a prime.

Original entry on oeis.org

3, 120, 528, 139128, 160554240, 812293020528, 379188080252621270252095320, 2816640597719456759751165488439681098364673273236637971046370174350128
Offset: 1

Author

Shreevatsa R, Jul 12 2013

Keywords

Examples

			139128 is both 527*528/2 and 373^2 - 1 (and 373 is prime).
		

Crossrefs

Subsequence of A006454 and of A225115.

Programs

  • Mathematica
    Select[Prime[Range[100000]]^2-1,OddQ[Sqrt[8#+1]]&] (* The program generates the first six terms of the sequence. *) (* Harvey P. Dale, Sep 17 2023 *)

Extensions

a(7)-a(8) from Giovanni Resta, Jul 13 2013

A161169 Triangle read by rows: T(n,k) = number of permutations of {1..n} with at most k inversions.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 5, 6, 1, 4, 9, 15, 20, 23, 24, 1, 5, 14, 29, 49, 71, 91, 106, 115, 119, 120, 1, 6, 20, 49, 98, 169, 259, 360, 461, 551, 622, 671, 700, 714, 719, 720, 1, 7, 27, 76, 174, 343, 602, 961, 1416, 1947, 2520, 3093, 3624, 4079, 4438, 4697, 4866, 4964, 5013
Offset: 0

Author

Shreevatsa R, Jun 04 2009

Keywords

Comments

T(n,k) is also the number of permutations with Kendall tau distance ("bubble-sort distance") to the identity permutation being at most k. This is the number of swaps performed by the bubble-sort algorithm to sort the sequence.
The above only gives T(n,k) for k<=n(n-1)/2, but T(n,k)=n! for all k>=n(n-1)/2.

Examples

			Triangle begins:
  1;
  1;
  1, 2;
  1, 3,  5,  6;
  1, 4,  9, 15, 20,  23,  24;
  1, 5, 14, 29, 49,  71,  91, 106, 115, 119, 120;
  1, 6, 20, 49, 98, 169, 259, 360, 461, 551, 622, 671, 700, 714, 719, 720;
  ...
T(3,2)=5 because there are 5 permutations of {1,2,3} with at most 2 inversions: (1,2,3) with 0 inversions, (1,3,2), (2,1,3) with 1 inversion each, (2,3,1), (3,1,2) with 2 inversions each.
T(n,0)=1 because there is exactly 1 permutation (the identity permutation) with no inversions,
T(n,k) = n! for all k >= n(n-1)/2 because all permutations have at most n(n-1)/2 inversions.
		

Crossrefs

Partial sums of A008302.

Programs

  • Python
    ct = {(0,0): 1}
    def c(n,k):
        if k<0: return 0
        k = min(k, n*(n-1)/2)
        if (n, k) in ct: return ct[(n, k)]
        ct[(n, k)] = c(n, k-1) + c(n-1, k) - c(n-1, k-n)
        return ct[(n, k)]

Formula

T(n,k) = Sum_{i s.t. n-i<=k} T(n-1, k-(n-i));
T(n,k) = Sum_{i=max(1,n-k)..n} T(n-1, k-n+i);
T(n,k) = Sum_{j=max(k-n+1,0)..n} T(n-1, j).
T(n,k) = T(n,k-1) + T(n-1,k) - T(n-1,k-n), taking T(n,k)=0 for k<0.
Also, T(n,k) = n! - T(n, n(n-1)/2-k-1).
For k<=n, T(n,k) = A008302(n+1,k).
G.f.: (1/(1-x))*Product_{j=1..n} (1-x^j)/(1-x) = Sum_{k>=0} T(n,k) x^k. - Alejandro H. Morales, Apr 04 2024