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: Roger Hui

Roger Hui's wiki page.

Roger Hui has authored 7 sequences.

A197487 Number of nonsingular n X n matrices with elements from {0,1,2}.

Original entry on oeis.org

1, 2, 50, 12792, 30844560, 671869521960, 129553882116606720
Offset: 0

Author

Roger Hui, Nov 29 2011

Keywords

Crossrefs

Programs

  • Mathematica
    (* 2x2 case *) cnt = 0; Do[d = Det[{{a, b}, {c, d}}]; If[d != 0, cnt++], {a, 0, 2}, {b, 0, 2}, {c, 0, 2}, {d, 0, 2}]; cnt (* T. D. Noe, Nov 29 2011 *)

Extensions

a(5)-a(6) from Minfeng Wang, May 29 2024
a(0)=1 prepended by Alois P. Heinz, May 29 2024

A112660 a(n) = (p-1)! mod p^2 where p = n-th prime.

Original entry on oeis.org

1, 2, 24, 34, 10, 168, 84, 37, 183, 521, 588, 258, 655, 558, 281, 1801, 1592, 3415, 803, 4898, 802, 5766, 1659, 6229, 6789, 7271, 5870, 106, 3269, 10734, 9016, 15588, 7671, 9312, 14005, 12985, 23706, 17603, 3506, 18337, 8591, 13031, 30368, 6754, 28958, 23481, 36502, 40139
Offset: 1

Author

Roger Hui, Dec 28 2005

Keywords

Comments

Related to the Wilson primes A007540, which are primes p such that (p-1)! = -1 mod p^2.

Crossrefs

Programs

  • Magma
    [Factorial(NthPrime(n)-1) mod NthPrime(n)^2 : n in [1..50]]; // G. C. Greubel, Dec 17 2019
    
  • Maple
    seq(`mod`(factorial(ithprime(n)-1), ithprime(n)^2), n = 1..50); # G. C. Greubel, Dec 17 2019
  • Mathematica
    Table[Mod[(Prime[n]-1)!, Prime[n]^2], {n, 50}] (* G. C. Greubel, Dec 17 2019 *)
  • PARI
    a(n) = my(p=prime(n)); (p-1)! % p^2; \\ Michel Marcus, Dec 17 2019
    
  • Sage
    [mod(factorial(nth_prime(n)-1), nth_prime(n)^2) for n in (1..50)] # G. C. Greubel, Dec 17 2019

Formula

a(n) = A177771(n) mod A001248(n). - Michel Marcus, Dec 17 2019

Extensions

Offset 1 and more terms from Michel Marcus, Dec 17 2019

A112632 Excess of 3k - 1 primes over 3k + 1 primes, beginning with 2.

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 4, 3, 2, 3, 2, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 4, 3, 4, 3, 2, 1, 2, 3, 4, 3, 4, 3, 4, 3, 2, 1, 2, 1, 2, 3, 2, 3, 4, 5, 6, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 3, 4, 3, 4, 5, 4, 3, 2, 3, 4, 3, 4, 3, 4, 3, 4, 3, 2, 3, 4, 3, 4, 3, 4, 5, 4, 5, 4, 5, 6, 7, 6, 5
Offset: 1

Author

Roger Hui, Dec 22 2005

Keywords

Comments

Cumulative sums of A134323, negated. The first negative term is a(23338590792) = -1 for the prime 608981813029. See page 4 of the paper by Granville and Martin. - T. D. Noe, Jan 23 2008 [Corrected by Jianing Song, Nov 24 2018]
See the comment about "Chebyshev's bias" in A321856. - Jianing Song, Nov 24 2018

Examples

			a(1) = 1 because 2 == -1 (mod 3).
a(2) = 1 because 3 == 0 (mod 3) and does not change the counting.
a(3) = 2 because 5 == -1 (mod 3).
a(4) = 1 because 7 == 1 (mod 3).
		

Crossrefs

Let d be a fundamental discriminant.
Sequences of the form "a(n) = -Sum_{primes p<=n} Kronecker(d,p)" with |d| <= 12: A321860 (d=-11), A320857 (d=-8), A321859 (d=-7), A066520 (d=-4), A321856 (d=-3), A321857 (d=5), A071838 (d=8), A321858 (d=12).
Sequences of the form "a(n) = -Sum_{i=1..n} Kronecker(d,prime(i))" with |d| <= 12: A321865 (d=-11), A320858 (d=-8), A321864 (d=-7), A038698 (d=-4), this sequence (d=-3), A321862 (d=5), A321861 (d=8), A321863 (d=12).

Programs

  • Haskell
    a112632 n = a112632_list !! (n-1)
    a112632_list = scanl1 (+) $ map negate a134323_list
    -- Reinhard Zumkeller, Sep 16 2014
    
  • Mathematica
    a[n_] := a[n] = a[n-1] + If[Mod[Prime[n], 6] == 1, -1, 1]; a[1] = a[2] = 1; Table[a[n], {n, 1, 100}]  (* Jean-François Alcover, Jul 24 2012 *)
    Accumulate[Which[IntegerQ[(#+1)/3],1,IntegerQ[(#-1)/3],-1,True,0]& /@ Prime[ Range[100]]] (* Harvey P. Dale, Jun 06 2013 *)
  • PARI
    a(n) = -sum(i=1, n, kronecker(-3, prime(i))) \\ Jianing Song, Nov 24 2018

Formula

a(n) = -Sum_{primes p<=n} Legendre(prime(i),3) = -Sum_{primes p<=n} Kronecker(-3,prime(i)) = -Sum_{i=1..n} A102283(prime(i)). - Jianing Song, Nov 24 2018

A112516 Numbers k such that the first 9 decimal digits of the k-th Fibonacci number is 1-9 pandigital.

Original entry on oeis.org

2749, 4589, 7102, 7727, 8198, 9383, 12633, 15708, 19014, 21206, 21303, 21434, 21566, 22706, 22890, 25790, 28244, 29877, 32174, 32717, 34433, 34883, 37965, 44691, 47422, 48635, 54473, 60438, 60536, 63902, 68340, 72424, 73147, 75873
Offset: 1

Author

Roger Hui, Dec 22 2005

Keywords

Examples

			The 2749th Fibonacci number is:
14372 68955 33879 17661 82964 56715 64334 14434 76345 06448 91772 ...
which is 1-9 pandigital in its first 9 digits.
		

Crossrefs

Programs

  • J
    NB. (www.jsoftware.com):
    plus=: 4 : 0
    'x xe'=. +. x.
    'y ye'=. +. y.
    e=. xe>.ye
    z=. (x*10^xe-e)+y*10^ye-e
    (z%10^b) j. e+b=. 10<:z
    )
    g =: 3 : '{."1 ({:,plus/)^:(
    				
  • Maple
    filter:= n -> convert(convert(combinat:-fibonacci(n),base,10)[-9..-1],set) = {$1..9}:
    select(filter, [$40.. 5 * 10^4]); # Robert Israel, May 31 2015
  • Mathematica
    fQ[n_] := Sort@Take[IntegerDigits@Fibonacci@n, 9] == {1, 2, 3, 4, 5, 6, 7, 8, 9}; Select[ Range[40, 77705], fQ[ # ] &] (* Robert G. Wilson v, Dec 27 2005 *)

Extensions

a(31)-a(34) from Robert G. Wilson v, Dec 27 2005

A111194 Permanent of the inverse Hilbert matrix.

Original entry on oeis.org

1, 1, 84, 1397520, 5314794912000, 4855173934730716800000, 1090093558153665322315192780800000, 60907190511553979457004412118419080463155200000
Offset: 0

Author

Roger Hui, Oct 22 2005

Keywords

Crossrefs

Cf. A005249 = determinant of inverse Hilbert matrix; and A092326 = (permanent/determinant) of inverse Hilbert matrix.

Programs

  • J
    NB. www.jsoftware.com
    H =: % @: >: @: (+/~) @: i. @ x:
    perm=: +/ .*
    perm@%.@H n
  • Mathematica
    Permanent[m_List] := With[{v = Array[x, Length[m]]}, Coefficient[Times @@ (m . v), Times @@ v]]; f[n_] := Block[{i = Inverse[Table[1/(i + j - 1), {i, n}, {j, n}]]}, Permanent[i]]; Table[ f[n], {n, 7}] (* Robert G. Wilson v, Oct 24 2005 *)

A111237 LCM of the absolute values of the inverse Hilbert matrix.

Original entry on oeis.org

1, 12, 2880, 226800, 101606400, 6985440000, 35961045120000, 1431699108840000, 692306057963520000, 181128033944995737600, 344143264495491901440000, 6651046563131624734080000, 22028266217091941119272960000
Offset: 1

Author

Roger Hui, Oct 28 2005

Keywords

Crossrefs

Cf. A005249 (determinant), A111194 (permanent), A092326 (permanent/determinant).

Programs

  • J
    NB. http://www.jsoftware.com
    H=: % @: >: @: (+/~) @: i. @: x:
    *./ @: | @:, @: %. @: H n

A112371 Numbers n such that the last 9 decimal digits of the n-th Fibonacci number is pandigital 1-9.

Original entry on oeis.org

541, 919, 1788, 6355, 16257, 17799, 20411, 24347, 28837, 36485, 40784, 43450, 45136, 45196, 51973, 54453, 54833, 57128, 57969, 63692, 67188, 67952, 69931, 74765, 76259, 78102, 78196, 78826, 81070, 81726, 87123, 87362, 91636, 91932
Offset: 1

Author

Roger Hui, Dec 22 2005

Keywords

Comments

Since the Fibonacci sequence mod 10^9 is periodic with period 1500000000, there is some positive M such that this sequence satisfies a(n+M) = a(n) + 1500000000. - Robert Israel, Jan 18 2015

Examples

			The 541st Fibonacci number is:
51621 23292 73937 94428 28328 17223 02417 68441 62155 65352
08137 22196 49050 89439 99028 11978 84249 30258 98332 77779
69788 39725 641
which is pandigital 1-9 in its last 9 digits.
		

References

  • Clifford A. Pickover, "Wonders of Numbers".

Crossrefs

Programs

  • J
    NB. In J (www.jsoftware.com).
    f=: 3 : '{."(1) 1e9&|@(+/\)@|.^:( ":&.> f n
  • Maple
    f:= proc(n) option remember; f(n-1)+f(n-2) mod 10^9 end proc:
    f(0):= 0: f(1):= 1:
    filter:= n -> convert(convert(f(n),base,10),set)={$1..9};
    select(filter, [$1..10^5]); # Robert Israel, Jan 18 2015