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: Marian Kraus

Marian Kraus's wiki page.

Marian Kraus has authored 11 sequences. Here are the ten most recent ones:

A287895 Differences of A287894.

Original entry on oeis.org

4, 13, 12, 3, 61, 42, 50, 39, 43, 80, 65, 89, 180, 110, 146, 160, 156, 187, 88, 118, 258, 243, 244, 282, 287, 189, 343, 311, 203, 410, 219, 467, 473, 274, 384, 535, 406, 484, 54, 825, 310, 558, 551, 375, 886, 659, 539, 515, 294, 914, 764, 478, 774, 757, 823
Offset: 1

Author

Marian Kraus, Jun 02 2017

Keywords

Comments

The first two negative terms are a(99) = -239 and a(999) = -5966. - Giovanni Resta, Jun 07 2017

Examples

			Take the differences of 1,5,18,30,... => 4,13,12,...
		

Crossrefs

Cf. A287894.

Programs

  • Maple
    ds:= n -> convert(convert(n,base,10),`+`):
    f:= n -> add(ds(k^n),k=1..n):
    A287894:= map(f, [$1..101]);
    A287894[2..101] - A287894[1..100]; # Robert Israel, Jun 30 2017
  • Mathematica
    s[n_] := Sum[Total@IntegerDigits[k^n], {k, n}]; Differences@ Array[s, 60] (* Giovanni Resta, Jun 07 2017 *)

A287894 Sum of the digit sums of the n-th powers of the first n positive integers.

Original entry on oeis.org

1, 5, 18, 30, 33, 94, 136, 186, 225, 268, 348, 413, 502, 682, 792, 938, 1098, 1254, 1441, 1529, 1647, 1905, 2148, 2392, 2674, 2961, 3150, 3493, 3804, 4007, 4417, 4636, 5103, 5576, 5850, 6234, 6769, 7175, 7659, 7713, 8538, 8848, 9406, 9957, 10332, 11218, 11877
Offset: 1

Author

Marian Kraus, Jun 02 2017

Keywords

Comments

The sequence is not increasing: a(100) < a(99). - Robert Israel, Jun 30 2017

Examples

			n=1: 1: 1;
n=2: 1,4: 1+4=5;
n=3: 1,8,27: 1+8+9=18;
n=4: 1,16,81,256: 1+7+9+13=30.
		

Crossrefs

Cf. A007953.

Programs

  • Maple
    ds:= n -> convert(convert(n,base,10),`+`):
    f:= n -> add(ds(k^n),k=1..n):
    map(f, [$1..50]); # Robert Israel, Jun 30 2017
  • Mathematica
    a[n_] := Sum[ Total@ IntegerDigits[k^n], {k, n}]; Array[a, 50] (* Giovanni Resta, Jun 07 2017 *)
  • PARI
    a(n) = sum(k=1, n, sumdigits(k^n)); \\ Michel Marcus, Jun 06 2017

Formula

a(n) = Sum_{k=1..n} digsum(k^n), n >= 1.

A265207 Draw a square and follow these steps: Take a square and place at its edges isosceles right triangles with the edge as hypotenuse. Draw a square at every new edge of the triangles. Repeat for all the new squares of the same size. New figures are only placed on empty space. The structure is symmetric about the first square. The sequence gives the numbers of squares of equal size in successive rings around the center.

Original entry on oeis.org

1, 8, 20, 36, 60, 92, 140, 204, 300, 428, 620, 876, 1260, 1772, 2540, 3564, 5100, 7148, 10220, 14316, 20460, 28652, 40940, 57324, 81900, 114668, 163820, 229356, 327660, 458732, 655340, 917484, 1310700, 1834988, 2621420, 3669996, 5242860, 7340012, 10485740, 14680044, 20971500, 29360108, 41943020, 58720236
Offset: 1

Author

Marian Kraus, Dec 04 2015

Keywords

Examples

			By recursion:
a(3)=2*a(1)+20=2*8+20=36
a(4)=2*a(2)+20=2*20+20=60
By function:
a(3)=4*sum_{k=1}^{[(3+1)/2]}(2^k)+6*sum_{k=1}^{[3/2]}(2^k)
=4*sum_{k=1}^{[2]}(2^k)+6*sum_{k=1}^{[1.5]}(2^k)
=4*sum_{k=1}^{2}(2^k)+6*sum_{k=1}^{1}(2^k)
=4*(2^1+2^2)+6*(2^1)
=4*(2+4)+6*(2)=24+12=36
a(4)=4*sum_{k=1}^{[(4+1)/2]}(2^k)+6*sum_{k=1}^{[4/2]}(2^k)
=4*sum_{k=1}^{[2.5]}(2^k)+6*sum_{k=1}^{[2]}(2^k)
=4*sum_{k=1}^{2}(2^k)+6*sum_{k=1}^{2}(2^k)
=4*(2^1+2^2)+6*(2^1+2^2)
=4*(2+4)+6*(2+4)=24+36=60
		

Crossrefs

For the differences (a(n)-a(n-1))/4, n>2, see A163978.

Programs

  • R
    rm(a)
    a <- vector() powerof2 <- vector()
    x <- 300
    n <- x/2
    for (i in 1:x){
       powerof2[i] <- 2^(i-1)}
    powerof2 for (i in 1:n){
       a[2*i]   <- 8*(sum(powerof2[1:i]))+12*(sum(powerof2[1:i]))}
    for (i in 1:(n+1)){
       a[2*i+1] <- 8*(sum(powerof2[1:(i+1)]))+12*(sum(powerof2[1:i]))}
    a[1]<-8
    a

Formula

Conjectured recurrence:
a(0)=1,
a(1)=8,
a(2)=20, and thereafter
a(n)=2*a(n-2)+20.
Conjectured formula: ("[]" is the floor function)
a(n)=4*sum_{k=1}^{[(n+1)/2]}(2^k)+6*sum_{k=1}^{[n/2]}(2^k).
Conjectures from Colin Barker, Dec 07 2015: (Start)
a(n) = (-20+2^(1/2*(-1+n))*(10-10*(-1)^n+7*sqrt(2)+7*(-1)^n*sqrt(2))) for n>1.
a(n) = 5*2^(n/2+1/2)-5*(-1)^n*2^(n/2+1/2)+7*2^(n/2)+7*(-1)^n*2^(n/2)-20 for n>1.
a(n) = a(n-1)+2*a(n-2)-2*a(n-3) for n>4.
G.f.: x*(1+7*x+10*x^2+2*x^3) / ((1-x)*(1-2*x^2)).
(End)

A256592 Let p = prime(n); a(n) = number of pairs (x,i) with i >= 2 and 2 <= x <= p-i such that x*(x+1)*(x+2)*...*(x+i-1) == 1 mod p.

Original entry on oeis.org

0, 0, 1, 2, 6, 3, 8, 7, 13, 15, 13, 11, 13, 22, 18, 25, 36, 31, 34, 53, 42, 38, 38, 40, 55, 47, 41, 37, 77, 59, 62, 67, 66, 63, 55, 84, 74, 78, 90, 74, 90, 92, 85, 108, 100, 117, 98, 104, 136, 114, 118, 118, 141, 112, 118, 115, 122, 138, 132, 129, 115, 152
Offset: 1

Author

Marian Kraus, Apr 03 2015

Keywords

Examples

			prime(1)=2: There is no such product
=> a(1)=0;
prime(2)=3: There is no such product
=> a(2)=0;
prime(3)=5: 2*3=6==1 mod 5
=> i=1, x=2; a(3)=1;
prime(4)=7: 4*5*6==1 mod 7; 2*3*4*5==1 mod 7
=> a(3)=2;
prime(5)=11: 3*4==1 mod 11; 7*8==1 mod 11; 5*6*7==1 mod 11; 3*4*5*6*7==1 mod 11; 6*7*8*9*10==1 mod 11; 2*3*4*5*6*7*8*9==1 mod 11
=> x in {3,7,5,3,6,2}
=> a(5)=6.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{r = Range[2, Prime[n] - 1]}, Sum[Length@ Select[Times @@@ Partition[r, k, 1], Mod[#, Prime@ n] == 1 &], {k, 2, Prime@ n}]]; Array[f, 72] (* Michael De Vlieger, Apr 03 2015 *)
  • R
    library(numbers)
    p <- vector()
    n <- vector()
    NumTup <- vector()
    p <- Primes(m)
    n <- length(p)
    m <- 17 #all primes will be checked up to this number
    Piprod <- matrix(0,m,m) #Matrix with zeros
    #loop: every ordered combination of products
    for (i in 2:m)
    for (j in 2:m)
      Piprod[j,i] <- ifelse(i
    				

A256580 Number of quadruples (x, x+1, x+2, x+3) with 1 < x < p-3 of consecutive integers whose product is 1 mod p.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 2, 0, 0, 0, 4, 0, 4, 0, 0, 4, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 4, 4, 2, 0, 2, 0, 0, 2, 0, 4, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 4, 2, 0, 0, 2, 0, 0, 0, 2, 0, 0, 4, 2, 2, 0, 4, 0, 0, 0, 0, 2, 4, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 2, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 2, 0, 0, 4, 4, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 2, 0, 4, 0, 2, 2, 0, 0, 4, 4, 0, 4, 2, 0, 0
Offset: 1

Author

Marian Kraus, Apr 02 2015

Keywords

Comments

If "quadruples" is changed to "pairs" we get A086937 (for the counts) and A038872 (for the primes for which the count is nonzero).

Examples

			p=7, x_1=2, 2*3*4*5 == 1 (mod 7), T={2}, |T|=1;
p=17, x_1=2, 2*3*4*5 == 1 (mod 17), x_2=12, 12*13*14*15 == 1 (mod 17), T={2,12}, |T|=2;
p=23, x_1=5, 5*6*7*8 == 1 (mod 23), x_2=15, 15*16*17*18 == 1 (mod 23), x_3=19, 19*20*21*22 == 1 (mod 23), T={5,15,19}, |T|=3.
		

Crossrefs

Programs

  • R
    library(numbers);IP <- vector();t <- vector();S <- vector();IP <- c(Primes(1000));for (j in 1:(length(IP))){for (i in 2:(IP[j]-4)){t[i-1] <-as.vector(mod((i*(i+1)*(i+2)*(i+3)),IP[j]));Z[j] <- sum(which(t==1));S[j] <- length(which(t==1))}};S

Formula

|T| where T = {x|x*(x+1)*(x+2)*(x+3) == 1 mod p, p is prime, 1 < x < p-3}.

A256567 Primes p with the property that there are three consecutive integers (x,x+1,x+2) with 1 < x <= p-3 whose product is 1 modulo p.

Original entry on oeis.org

7, 11, 17, 19, 23, 37, 43, 53, 59, 61, 67, 79, 83, 89, 97, 101, 103, 107, 109, 113, 137, 149, 157, 167, 173, 181, 191, 199, 211, 223, 227, 229, 241, 251, 263, 271, 281, 283, 293, 307, 313, 317, 337, 347, 359, 367, 373, 379, 383, 389, 401, 419, 421, 431, 433, 449
Offset: 1

Author

Marian Kraus, Apr 02 2015

Keywords

Comments

There may be one or more such triples, but 23 is the only prime up to 100000 having precisely two such triples. For the number of triples for each prime, see A256572.
Together with 5, supersequence of A191065. - Arkadiusz Wesolowski, Nov 24 2021

Examples

			For p=7: 4*5*6=120==1 (mod 7), so 7 is a term.
For p=11: 5*6*7=210==1 (mod 11), so 11 is a term.
For p=17: 4*5*6=120==1 (mod 17), so 17 is a term.
13 is not a term because there is no such triple with product ==  1 (mod 13).
		

Crossrefs

Programs

  • PARI
    isok(p) = {if (isprime(p), for (x=1, p-3, if (Mod(x*(x+1)*(x+2), p) == 1, return (1));););} \\ Michel Marcus, Oct 05 2021
  • R
    library(numbers)
    IP <- vector()
    t <- vector()
    S <- vector()
    IP <- c(Primes(1000)) # Build a vector of all primes < 1000.
    for (j in 1:(length(IP))){
       for (i in 3:(IP[j]-2))
          t[i-1] <- as.vector(mod(((i-1)*i*(i+1)),IP[j]))
       S[j] <- length(which(t==1))
    }
    IP[S!=0]
    #The loop checks for every triple for every prime, what it is modulo that prime. "IP[S!=0]" lists the primes that have at least one triple. For all p<10000 it takes a few minutes. For all p<100000 a few hours.
    

A256572 Number of triples (x,x+1,x+2) with 1 < x <= p-3 of consecutive integers less than p whose product is 1 modulo p, where p = prime(n).

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 1, 1, 2, 0, 0, 1, 0, 1, 0, 1, 3, 1, 1, 0, 0, 1, 1, 1, 1, 3, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 3, 3, 0, 1, 1, 0, 0, 1, 3, 3, 1, 1, 0, 0, 1, 1, 0, 1, 0, 3, 0, 1, 1, 1, 3, 0, 1, 3, 0, 1, 3, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 3, 1, 0, 3, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 3, 3, 0, 3, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 3, 1, 1, 3, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 3, 0, 3, 0, 1, 3, 1, 3, 0, 0, 0, 3, 1, 3, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 3, 3
Offset: 1

Author

Marian Kraus, Apr 02 2015

Keywords

Comments

Is 23 the only prime with two triples?

Examples

			For p=7: 4*5*6==1 (mod 7); T={4}, |T|=1.
For p=23: 2*3*4==1 (mod 23) and 9*10*11==1 (mod 23); T={2,9}, |T|=2.
For p=59: 3*4*5==1 (mod 59), 12*13*14==1 (mod 59), and 41*42*43==1 (mod 59); T={3,12,41}, |T|=3.
		

Crossrefs

Cf. A256567.

Programs

  • PARI
    a(n) = {my(p = prime(n)); sum(x=2, p-3, (x*(x+1)*(x+2)) % p == 1);} \\ Michel Marcus, Apr 03 2015
  • R
    library(numbers);IP <- vector();t <- vector();S <- vector();IP <- c(Primes(1000));LIP <- length(IP);for (j in 1:LIP){for (i in (3:(IP[j]-2))){t[i-1] <- as.vector(mod(((i-1)*i*(i+1)),IP[j]))};S[j] <- length(which(t==1))};S
    #Needs a lot of memory. For Primes(100000), this takes a few hours.
    

Formula

|T| where T={x|x*(x+1)*(x+2)==1 (mod p), p is prime, 1

A254678 Primes p with the property that there are four consecutive integers less than p whose product is 1 mod p.

Original entry on oeis.org

7, 17, 23, 31, 41, 47, 73, 89, 97, 103, 127, 137, 151, 167, 199, 223, 233, 239, 241, 257, 271, 281, 311, 313, 353, 359, 367, 383, 409, 431, 433, 439, 449, 479, 487, 503, 521, 577, 593, 601, 607, 647, 673, 719, 727, 743, 751, 761, 769, 839, 857, 881, 887, 911, 929, 937, 953, 967, 977, 983
Offset: 1

Author

Marian Kraus, Apr 02 2015

Keywords

Examples

			p=7: 2*3*4*5=120 == 1 mod 7;
p=17: 2*3*4*5=120 == 1 mod 17 AND 12*13*14*15=32760 == 1 mod 17; for p=13: no triple == 1 mod 13;
p=23: 5*6*7*8 == 1 mod 23 AND 15*16*17*18== 1 mod 23 AND 19*20*21*22 == 1 mod 23; and so on. For the number of quadruples for a prime, see A256580.
		

Crossrefs

Programs

  • Mathematica
    fsiQ[n_]:=AnyTrue[Times@@@Partition[Range[n-1],4,1],Mod[#,n]==1&]; Select[ Prime[Range[200]],fsiQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 02 2019 *)
  • PARI
    lista(nn) = forprime(p=2, nn, if (sum(x=1, p-4, ((x*(x+1)*(x+2)*(x+3)) % p) == 1) > 0, print1(p, ", "))); \\ Michel Marcus, Apr 03 2015
  • R
    library(numbers)
    IP <- vector()
    t <- vector()
    S <- vector()
    IP <- c(Primes(1000))
    for (j in 1:(length(IP))){
       for (i in 2:(IP[j]-4)){
           t[i-1] <- as.vector(mod((i*(i+1)*(i+2)*(i+3)),IP[j]))
           Z[j] <- sum(which(t==1))
           S[j] <- length(which(t==1))
       }
    }
    IP[S!=0]
    #Carefully increase Primes(1000). It takes several hours for 100000.
    

Formula

x*(x+1)*(x+2)*(x+3) == 1 mod p, p is prime, 1 <= x <= p-4.

A113397 What are the values of k in the term Prime(n+1)^2-Prime(n)^2 = a+k*(Prime(n+1)) if "a" is element of {0,1,...,Prime(n+1)-1}.

Original entry on oeis.org

1, 3, 3, 6, 3, 7, 3, 7, 10, 3, 11, 7, 3, 7, 11, 11, 3, 11, 7, 3, 11, 7, 11, 15, 7, 3, 7, 3, 7, 26, 7, 11, 3, 19, 3, 11, 11, 7, 11, 11, 3, 19, 3, 7, 3, 23, 23, 7, 3, 7, 11, 3, 19
Offset: 1

Author

Marian Kraus, Oct 26 2005

Keywords

Examples

			3^2-2^2=2+1*3; 5^2-3^2=1+3*5; 7^2-5^2=3+3*7; 11^2-7^2=6+6*11; 13^2-11^2=9+3*13; etc.
		

Crossrefs

Cf. A113396.

Formula

Prime(n+1)^2-Prime(n)^2 = a+k*(Prime(n+1)) "a" element of {0, 1, ..., Prime(n+1)-1}

A113398 How many times did the value of k appear at the previous primes including the n-th one? (Prime(n+1))^2-(Prime(n))^2 = a+k*(Prime(n+1)) if a is element of {0,1,...,Prime(n+1)-1}.

Original entry on oeis.org

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

Author

Marian Kraus, Oct 26 2005

Keywords

Examples

			3^2-2^2 = 2+1*3 (first "1"); 5^2-3^2 = 1+3*5 (first "3"); 7^2-5^2 = 3+3*7 (2nd "3");
11^2-7^2 = 6+6*11 (first "6"); 13^2-11^2 = 9+3*13 (3rd "3"); etc.
		

Crossrefs