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

A192419 Smallest k such that 1^3, 2^3, 3^3,... n^3 are distinct modulo k.

Original entry on oeis.org

1, 2, 3, 5, 5, 6, 10, 10, 10, 10, 11, 15, 15, 15, 15, 17, 17, 22, 22, 22, 22, 22, 23, 29, 29, 29, 29, 29, 29, 30, 33, 33, 33, 34, 41, 41, 41, 41, 41, 41, 41, 46, 46, 46, 46, 46, 47, 51, 51, 51, 51, 53, 53, 55, 55, 58, 58, 58, 59, 66, 66, 66, 66, 66, 66, 66, 69, 69, 69, 71, 71, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82
Offset: 1

Views

Author

R. J. Mathar, Jun 30 2011

Keywords

Comments

The discriminator D(3,n).
It appears that a(n) ~ n. Is there an explicit formula as for A016726? - M. F. Hasler, May 04 2016

Crossrefs

Programs

  • Maple
    dis := proc(j,n) local k,s,i; for k from 1 do s := {} ; for i from 1 to n do s := s union { (i^j) mod k} ;
    end do: if nops(s) = n then return k; end if; end do: end proc:
    A192419 := proc(n) dis(3,n) ; end proc:
  • Mathematica
    dmk[n_]:=Module[{k=1,res},While[res=Table[PowerMod[i,3,k],{i,n}]; Length[ res]!= Length[Union[res]],k++];k]; Array[dmk,90] (* Harvey P. Dale, Jan 28 2013 *)
  • PARI
    A192419(nMax)={my(S=[],a=1);vector(nMax, n, S=concat(S,n^3); while(#Set(S%a)M. F. Hasler, May 04 2016

A192420 Smallest k such that 1^4, 2^4, 3^4,... ,n^4 are distinct modulo k.

Original entry on oeis.org

1, 2, 6, 9, 11, 14, 14, 18, 19, 22, 22, 31, 31, 31, 31, 38, 38, 38, 38, 43, 43, 46, 46, 59, 59, 59, 59, 59, 59, 62, 62, 67, 67, 71, 71, 79, 79, 79, 79, 83, 83, 86, 86, 94, 94, 94, 94, 103, 103, 103, 103, 107, 107, 118, 118, 118, 118, 118, 118, 127, 127, 127, 127, 131, 131, 134, 134, 139, 139
Offset: 1

Views

Author

R. J. Mathar, Jun 30 2011

Keywords

Comments

The discriminator D(4,n).

Crossrefs

Programs

  • Maple
    dis := proc(j,n) local k,s,i; for k from 1 do s := {} ; for i from 1 to n do s := s union { (i^j) mod k} ; end do: if nops(s) = n then return k; end if; end do: end proc:
    A192420 := proc(n) dis(4,n) ; end proc:
  • Mathematica
    a[n_] := For[k = 1, True, k++, If[Unequal @@ PowerMod[Range[n], 4, k], Return[k]]]; Array[a, 100] (* Jean-François Alcover, May 18 2018 *)
  • PARI
    A192420(nMax,f=n->n^4)={my(S=[],a=1); vector(nMax,n,S=concat(S,f(n));while(#Set(S%a)M. F. Hasler, May 04 2016

A272633 Discriminator of the primes: Least m > 0 such that (prime(1),...,prime(n)) are all different mod m; a(0) = 0 by convention.

Original entry on oeis.org

0, 1, 2, 4, 6, 7, 7, 13, 13, 13, 19, 19, 19, 23, 23, 23, 31, 31, 31, 33, 37, 37, 43, 43, 47, 49, 53, 53, 53, 55, 61, 63, 67, 73, 73, 75, 75, 79, 83, 83, 89, 89, 91, 91, 97, 103, 103, 109, 113, 113, 115, 117, 119, 121, 121, 121, 121, 121, 139, 139, 141, 141, 151, 153, 157, 157, 159, 167, 169, 169, 175, 181, 181, 183, 187
Offset: 0

Views

Author

M. F. Hasler, May 04 2016

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local m;
          for m from `if`(n=1, 1, a(n-1)) while
            n<>nops({seq(ithprime(i) mod m, i=1..n)})
          do od; m
        end: a(0):=0:
    seq(a(n), n=0..80);  # Alois P. Heinz, May 04 2016
  • Mathematica
    a[0]=0; a[n_]:=Block[{m=1}, While[Length@ DeleteDuplicates@ Mod[Prime@ Range@ n, m] != n, m++]; m]; a /@ Range[0, 74] (* Giovanni Resta, May 04 2016 *)
  • PARI
    A272633(nMax)={my(S=[],a=1);vector(nMax, n, S=concat(S,prime(n)); while(#Set(S%a)
    				

A270151 Discriminator of the Fibonacci numbers; least positive integer r such that F(2), F(3), ..., F(n+1) are all incongruent modulo r.

Original entry on oeis.org

1, 2, 3, 5, 8, 9, 14, 14, 15, 15, 15, 30, 30, 30, 30, 30, 35, 35, 35, 35, 59, 59, 59, 59, 79, 79, 83, 83, 83, 83, 83, 83, 120, 120, 120, 157, 157, 157, 157, 173, 173, 173, 173, 173, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 311, 311, 311, 311, 337, 337, 337, 337, 337, 409, 409, 409, 409, 431
Offset: 1

Views

Author

Jeffrey Shallit, Mar 12 2016

Keywords

Crossrefs

Cf. A016726.

A293390 Least m such that the exponents in expression for n as a sum of distinct powers of 2 are pairwise distinct mod m; a(0) = 0 by convention.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Oct 08 2017

Keywords

Comments

The set of exponents in expression for n as a sum of distinct powers of 2 corresponds to the n-th row of A133457.
The sum of digits of n in base 2^a(n), say s, can be computed without carry in base 2; the Hamming weight of s equals the Hamming weight of n.
a(n) >= A000120(n) for any n > 0.
Apparently, a(n) = A000120(n) iff n = 0 or n belongs to A100290.
a(n) <= A070939(n) for any n >= 0.
For any sequence s of distinct nonnegative integers (s(n) being defined for n >= 0):
- let D_s be defined for any n > 0 by D_s(n) = a(Sum_{k=0..n-1} 2^s(k)),
- then D_s is the discriminator of s as introduced by Arnold, Benkoski, and McCabe in 1985,
- D_s(1) = 1,
- D_s(n) >= n for any n >= 1,
- D_s(n+1) >= D_s(n) for any n >= 1.

Examples

			For n=42:
- 42 = 2^5 + 2^3 + 2^1,
- 5 mod 1 = 3 mod 1,
- 5 mod 2 = 3 mod 2,
- 5 mod 3, 3 mod 3 and 1 mod 3 are all distinct,
- hence a(42) = 3.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local L,D,k;
      L:= convert(n,base,2);
      L:= select(t -> L[t+1]=1, [$0..nops(L)-1]);
      if nops(L) = 1 then return 1 fi;
      D:= {seq(seq(L[j]-L[i],i=1..j-1),j=2..nops(L))};
      D:= `union`(seq(numtheory:-divisors(i),i=D));
      min({$2..max(D)+1} minus D)
    end proc:
    0, seq(f(i),i=1..100); # Robert Israel, Oct 08 2017
  • Mathematica
    {0}~Join~Table[Function[r, SelectFirst[Range@ 10, Length@ Union@ Mod[r, #] == Length@ r &]][Join @@ Position[#, 1] - 1 &@ Reverse@ IntegerDigits[n, 2]], {n, 86}] (* Michael De Vlieger, Oct 08 2017 *)
  • PARI
    a(n) = if (n, my (d=Vecrev(binary(n)), x = []); for (i=1, #d, if (d[i], x = concat(x, i-1))); for (m=1, oo, if (#Set(vector(#x, i, x[i]%m))==#x, return (m))), return (0))

Formula

a(2*n) = a(n) for any n >= 0.
a(2^k-1) = k for any k >= 0.
a(n) = 1 iff n = 2^k for some k >= 0.
a(n) = 2 iff n belongs to A173195.
a(Sum_{k=1..n} 2^(k^2)) = A016726(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000069(k)) = A062383(n) for any n >= 1.
a(Sum_{k=0..n} 2^(2^k)) = A270097(n) for any n >= 0.
a(Sum_{k=1..n} 2^A000045(k+1)) = A270151(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000041(k)) = A270176(n) for any n >= 1.
a(A076793(n)) = A272633(n) for any n >= 0.
a(Sum_{k=1..n} 2^A001969(k)) = A272881(n) for any n >= 1.
a(Sum_{k=1..n} 2^A005823(k)) = A272882(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000215(k-1)) = A273037(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000108(k)) = A273041(n) for any n >= 1.
a(Sum_{k=1..n} 2^A001566(k)) = A273043(n) for any n >= 1.
a(Sum_{k=1..n} 2^A003095(k)) = A273044(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000058(k-1)) = A273056(n) for any n >= 1.
a(Sum_{k=1..n} 2^A002808(k)) = A273062(n) for any n >= 1.
a(Sum_{k=1..n} 2^(k!)) = A273064(n) for any n >= 1.
a(Sum_{k=1..n} 2^(k^k)) = A273068(n) for any n >= 1.
a(Sum_{k=1..n} 2^A000110(k)) = A273237(n) for any n >= 1.
a(Sum_{k=1..n} 2^A001147(k)) = A273377(n) for any n >= 1.

A347693 Smallest k >= 2*n such that k is a prime or twice a prime.

Original entry on oeis.org

2, 2, 4, 6, 10, 10, 13, 14, 17, 19, 22, 22, 26, 26, 29, 31, 34, 34, 37, 38, 41, 43, 46, 46, 53, 53, 53, 58, 58, 58, 61, 62, 67, 67, 71, 71, 73, 74, 79, 79, 82, 82, 86, 86, 89, 94, 94, 94, 97, 101, 101, 103, 106, 106, 109, 113, 113, 118, 118, 118, 122, 122, 127, 127, 131, 131, 134
Offset: 0

Views

Author

N. J. A. Sloane, Oct 04 2021

Keywords

Comments

Suggested by the formula for A016726.

Crossrefs

A347694 Largest k <= 2*n such that k is a prime or twice a prime.

Original entry on oeis.org

2, 4, 6, 7, 10, 11, 14, 14, 17, 19, 22, 23, 26, 26, 29, 31, 34, 34, 38, 38, 41, 43, 46, 47, 47, 47, 53, 53, 58, 59, 62, 62, 62, 67, 67, 71, 74, 74, 74, 79, 82, 83, 86, 86, 89, 89, 94, 94, 97, 97, 101, 103, 106, 107, 109, 109, 113, 113, 118, 118, 122, 122, 122, 127, 127, 131, 134, 134, 137, 139
Offset: 1

Views

Author

N. J. A. Sloane, Oct 05 2021

Keywords

Comments

Suggested by the formula for A016726.

Crossrefs

Programs

  • Mathematica
    lkp2p[n_]:=Module[{k=2n},While[NoneTrue[{k,k/2},PrimeQ],k--];k]; Array[lkp2p,200] (* Harvey P. Dale, Mar 01 2025 *)
Showing 1-7 of 7 results.