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-5 of 5 results.

A201909 Irregular triangle of 3^k mod prime(n).

Original entry on oeis.org

1, 0, 1, 3, 4, 2, 1, 3, 2, 6, 4, 5, 1, 3, 9, 5, 4, 1, 3, 9, 1, 3, 9, 10, 13, 5, 15, 11, 16, 14, 8, 7, 4, 12, 2, 6, 1, 3, 9, 8, 5, 15, 7, 2, 6, 18, 16, 10, 11, 14, 4, 12, 17, 13, 1, 3, 9, 4, 12, 13, 16, 2, 6, 18, 8, 1, 3, 9, 27, 23, 11, 4, 12, 7, 21, 5, 15
Offset: 1

Views

Author

T. D. Noe, Dec 07 2011

Keywords

Comments

The row lengths are in A062117. Except for the second row, the first term of each row is 1. Many sequences are in this one: starting at A036119 (mod 17) and A070341 (mod 11).

Examples

			The first 9 rows are:
  1
  0
  1, 3, 4,  2
  1, 3, 2,  6,  4,  5
  1, 3, 9,  5,  4
  1, 3, 9
  1, 3, 9, 10, 13,  5, 15, 11, 16, 14,  8,  7,  4, 12, 2,  6
  1, 3, 9,  8,  5, 15,  7,  2,  6, 18, 16, 10, 11, 14, 4, 12, 17, 13
  1, 3, 9,  4, 12, 13, 16,  2,  6, 18,  8
		

Crossrefs

Cf. A062117, A201908 (2^k), A201910 (5^k), A201911 (7^k).
Cf. A070352 (5), A033940 (7), A070341 (11), A168399 (13), A036119 (17), A070342 (19), A070356 (23), A070344 (29), A036123 (31), A070346 (37), A070361 (41), A036126 (43), A070364 (47), A036134 (79), A036136 (89), A036142 (113), A036143 (127), A036145 (137), A036158 (199), A036160 (223).

Programs

  • GAP
    P:=Filtered([1..350],IsPrime);;
    R:=List([1..Length(P)],n->OrderMod(7,P[n]));;
    Flat(Concatenation([1,1,1,2,4,3,0],List([5..10],n->List([0..R[n]-1],k->PowerMod(7,k,P[n]))))); # Muniru A Asiru, Feb 01 2019
  • Mathematica
    nn = 10; p = 3; t = p^Range[0,Prime[nn]]; Flatten[Table[If[Mod[n, p] == 0, {0}, tm = Mod[t, n]; len = Position[tm, 1, 1, 2][[-1,1]]; Take[tm, len-1]], {n, Prime[Range[nn]]}]]

A335365 Numbers that are unreachable by the process of starting from 1 and adding 5 and/or multiplying by 3.

Original entry on oeis.org

2, 4, 5, 7, 10, 12, 15, 17, 20, 22, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180, 185, 190, 195, 200, 205, 210, 215, 220, 225, 230, 235, 240, 245, 250, 255, 260, 265, 270, 275, 280, 285
Offset: 1

Views

Author

Alonso del Arte, Jun 03 2020

Keywords

Comments

Start with 1. Add 5 or multiply by 3. Then either add 5 or multiply by 3, and so on and so forth. Following both branches at each step, we can create a tree like this:
1
................../ \..................
6 3
11......../ \........18 8......../ \........9
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
16 33 23 54 13 24 14 27
21 48 38 99 28 69 59 162 18 39 29 72 19 42 32 81
According to Haverbeke (2019), some numbers, like 13, are reachable by this process in at least one way. Other numbers, like 15, are completely unreachable.
In fact, almost all positive integers that are not multiples of 5 are reachable, and all multiples of 5 (A008587) are unreachable.
The latter assertion is proven easily enough by taking note of the powers of 3 modulo 5: 1, 3, 4, 2, 1, 3, 4, 2, 1, 3, 4, 2, ... (A070352).
As for the former assertion, it is enough to note that 26, 27, 28 and 29 are reachable. Given 5k + r, with k > 4 and r one of 1, 2, 3, 4, start with the solution for 25 + r and then, k - 5 times, add 5.
More precisely the sequence consists of all multiples of 5, numbers less than 25 congruent to 2 (mod 5), and 4. - M. F. Hasler, Jun 05 2020

Examples

			Starting with 1, either adding 5 or multiplying by 3 results in a number greater than 2, so 2 is unreachable and therefore in the sequence.
Starting with 1, multiplying by 3 gives 3, proving 3 is reachable and therefore not in the sequence.
		

References

  • Marijn Haverbeke, Eloquent JavaScript, 3rd Ed. San Francisco (2019): No Starch, p. 51.

Crossrefs

Cf. A008587 (subset), A070352, A335392.
Subsets of the complement: A000244, A016861, A016873 (except for first five terms), A016885, A016897 (except for 4).

Programs

  • JavaScript
    // See Haverbeke (2019).
    
  • Mathematica
    LinearRecurrence[{2,-1},{2,4,5,7,10,12,15,17,20,22,25,30},70] (* Harvey P. Dale, Apr 01 2023 *)
  • PARI
    {is(n)=!(n%5&& !while(n>4, n%3|| is(n/3)|| break (n=1); n-=5)&& n%2==1)} \\ Using exhaustive search, for illustration. - M. F. Hasler, Jun 05 2020
    
  • PARI
    select( {is(n)=n%5==0|| (n<23&&(n%5==2||n==4))}, [1..199]) \\ Much more efficient. - M. F. Hasler, Jun 05 2020
    
  • PARI
    Vec(x*(2 - x^2 + x^3 + x^4 - x^5 + x^6 - x^7 + x^8 - x^9 + x^10 + 2*x^11) / (1 - x)^2 + O(x^50)) \\ Colin Barker, Jun 07 2020
  • Scala
    // Based on Haverbeke (2019)
    def find153Sol(n: Int): List[Int] = {
      def recur153(curr: Int, history: List[Int]): List[Int] = {
        if (curr == n) history.drop(1) :+ n else if (curr > n) List() else {
          val add5Branch = recur153(curr + 5, history :+ curr)
          if (add5Branch.nonEmpty) add5Branch
              else recur153(curr * 3, history :+ curr)
        }
      }
      recur153(1, List(1))
    }
    (1 to 200).filter(find153Sol(_).isEmpty)
    

Formula

G.f.: (2*x^11 + x^10 - x^9 + x^8 - x^7 + x^6 - x^5 + x^4 + x^3 - x^2 + 2)*x/(x - 1)^2. - Alois P. Heinz, Jun 05 2020
From Colin Barker, Jun 07 2020: (Start)
a(n) = 2*a(n-1) - a(n-2) for n>12.
a(n) = 5*(n-6) for n>10.
(End)

A271350 a(n) = 3^n mod 83.

Original entry on oeis.org

1, 3, 9, 27, 81, 77, 65, 29, 4, 12, 36, 25, 75, 59, 11, 33, 16, 48, 61, 17, 51, 70, 44, 49, 64, 26, 78, 68, 38, 31, 10, 30, 7, 21, 63, 23, 69, 41, 40, 37, 28, 1, 3, 9, 27, 81, 77, 65, 29, 4, 12, 36, 25, 75, 59, 11, 33, 16, 48, 61, 17, 51, 70, 44, 49, 64, 26
Offset: 0

Views

Author

Vincenzo Librandi, Apr 05 2016

Keywords

Crossrefs

Cf. similar sequences of the type 3^n mod p, where p is a prime: A070352 (5), A033940 (7), A070341 (11), A168399 (13), A036119 (17), A070342 (19), A070356 (23), A070344 (29), A036123 (31), A070346 (37), A070361 (41), A036126 (43), A070364 (47), A036134 (79), this sequence (83), A036136 (89), A036142 (113), A036143 (127), A271351 (131), A036145 (137), A036158 (199), A271352 (211), A036160 (223).

Programs

  • Magma
    [Modexp(3, n, 83): n in [0..100]];
    
  • Mathematica
    PowerMod[3, Range[0, 100], 83]
  • PARI
    a(n) = lift(Mod(3, 83)^n); \\ Altug Alkan, Apr 05 2016

Formula

a(n) = a(n-41).

A348592 a(n) = F(n)*F(n+1) mod L(n+2) where F=A000045 is the Fibonacci numbers and L = A000032 is the Lucas numbers.

Original entry on oeis.org

0, 1, 2, 6, 15, 11, 10, 45, 99, 79, 65, 312, 675, 545, 442, 2142, 4623, 3739, 3026, 14685, 31683, 25631, 20737, 100656, 217155, 175681, 142130, 689910, 1488399, 1204139, 974170, 4728717, 10201635, 8253295, 6677057, 32411112, 69923043, 56568929, 45765226, 222149070, 479259663, 387729211, 313679522
Offset: 0

Views

Author

J. M. Bergot and Robert Israel, Jan 25 2022

Keywords

Examples

			a(5) = F(5)*F(6) mod L(7) = 5*8 mod 29 = 11.
		

Crossrefs

Programs

  • Maple
    F:= combinat:-fibonacci:
    L:= n -> F(n-1)+F(n+1):
    seq(F(n)*F(n+1) mod L(n+2), n=0..20);
  • Mathematica
    a[n_] := Mod[Fibonacci[n] * Fibonacci[n + 1], LucasL[n + 2]]; Array[a, 50, 0] (* Amiram Eldar, Jan 26 2022 *)

Formula

For n >= 1, a(n) = (A070352(n+2)*A000032(n+2) + 3*(-1)^n)/5.
a(n) + 2*a(n + 1) + 3*a(n + 2) + 5*a(n + 3) + a(n + 4) - a(n + 5) - a(n + 7) = 0 for n >= 1.
G.f.: -3 + 3/(5*(1+x)) + (3+x)/(2*(1-x-x^2)) + (9-4*x+6*x^2-x^3)/(10*(1+3*x^2+x^4)).

A160186 Lodumo_5 of Lucas numbers.

Original entry on oeis.org

2, 1, 3, 4, 7, 6, 8, 9, 12, 11, 13, 14, 17, 16, 18, 19, 22, 21, 23, 24, 27, 26, 28, 29, 32, 31, 33, 34, 37, 36, 38, 39, 42, 41, 43, 44, 47, 46, 48, 49, 52, 51, 53, 54, 57, 56, 58, 59, 62, 61, 63, 64, 67, 66, 68, 69, 72, 71, 73, 74, 77, 76, 78, 79, 82, 81, 83, 84, 87, 86, 88, 89
Offset: 0

Views

Author

Philippe Deléham, May 03 2009

Keywords

Comments

Multiples of 5 (see A008587) are missing .

Crossrefs

Formula

a(n)=lod_5(A000032(n)).
Showing 1-5 of 5 results.