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.

Previous Showing 11-20 of 204 results. Next

A073788 Numbers in base -7.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 160, 161, 162, 163, 164, 165, 166, 150, 151, 152, 153, 154, 155, 156, 140, 141, 142, 143, 144, 145, 146, 130, 131, 132, 133, 134, 135, 136, 120, 121, 122, 123, 124, 125, 126, 110, 111, 112, 113, 114, 115, 116, 100, 101, 102, 103, 104, 105
Offset: 0

Views

Author

Robert G. Wilson v, Aug 11 2002

Keywords

References

  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, 1969, Vol. 2, p. 189.

Crossrefs

Programs

  • Mathematica
    ToNegaBases[i_Integer, b_Integer] := FromDigits[ Rest[ Reverse[ Mod[ NestWhileList[(#1 - Mod[ #1, b])/-b &, i, #1 != 0 &], b]]]]; Table[ ToNegaBases[n, 7], {n, 0, 60}]
  • Python
    def A073788(n):
        s, q = '', n
        while q >= 7 or q < 0:
            q, r = divmod(q, -7)
            if r < 0:
                q += 1
                r += 7
            s += str(r)
        return int(str(q)+s[::-1]) # Chai Wah Wu, Apr 09 2016

A293660 Base-7 circular primes that are not base-7 repunits.

Original entry on oeis.org

11, 13, 17, 19, 23, 29, 37, 41, 43, 47, 79, 89, 97, 109, 131, 211, 233, 257, 263, 281, 307, 337, 439, 479, 509, 571, 619, 673, 677, 853, 941, 953, 977, 997, 1021, 1097, 1117, 1163, 1171, 1453, 1511, 1531, 1579, 1597, 1657, 1777, 1787, 1811, 1871, 1933, 1951
Offset: 1

Views

Author

Felix Fröhlich, Dec 30 2017

Keywords

Comments

Conjecture: The sequence is finite, with 13143449029 being the last term. - [Comment extended by Felix Fröhlich, May 30 2019]

Examples

			109 written in base 7 is 214. The base-7 numbers 214, 142, 421 written in base 10 are 109, 79, 211, respectively, and all those numbers are prime, so 79, 109 and 211 are terms of the sequence.
		

Crossrefs

Cf. base-b nonrepunit circular primes: A293657 (b=4), A293658 (b=5), A293659 (b=6), A293661 (b=8), A293662 (b=9), A293663 (b=10).

Programs

  • Mathematica
    With[{b = 7}, Select[Prime@ Range[PrimePi@ b + 1, 300], Function[w, And[AllTrue[Array[FromDigits[RotateRight[w, #], b] &, Length@ w - 1], PrimeQ], Union@ w != {1} ]]@ IntegerDigits[#, b] &]] (* Michael De Vlieger, Dec 30 2017 *)
  • PARI
    rot(n) = if(#Str(n)==1, v=vector(1), v=vector(#n-1)); for(i=2, #n, v[i-1]=n[i]); u=vector(#n); for(i=1, #n, u[i]=n[i]); v=concat(v, u[1]); v
    decimal(v, base) = my(w=[]); for(k=0, #v-1, w=concat(w, v[#v-k]*base^k)); sum(i=1, #w, w[i])
    is_circularprime(p, base) = my(db=digits(p, base), r=rot(db), i=0); if(vecmin(db)==0, return(0), while(1, dec=decimal(r, base); if(!ispseudoprime(dec), return(0)); r=rot(r); if(r==db, return(1))))
    forprime(p=1, , if(vecmin(digits(p, 7))!=vecmax(digits(p, 7)), if(is_circularprime(p, 7), print1(p, ", "))))

A073794 Replace 7^k with (-7)^k in base 7 expansion of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, -7, -6, -5, -4, -3, -2, -1, -14, -13, -12, -11, -10, -9, -8, -21, -20, -19, -18, -17, -16, -15, -28, -27, -26, -25, -24, -23, -22, -35, -34, -33, -32, -31, -30, -29, -42, -41, -40, -39, -38, -37, -36, 49, 50, 51, 52, 53, 54, 55, 42, 43, 44, 45, 46, 47, 48, 35, 36, 37, 38, 39, 40, 41
Offset: 0

Views

Author

Robert G. Wilson v, Aug 12 2002

Keywords

Comments

Base 7 representation for n (in lexicographic order) converted from base -7 to base 10.

Crossrefs

Programs

  • Mathematica
    f[n_Integer, b_Integer] := Block[{l = IntegerDigits[n]}, Sum[l[[ -i]]*(-b)^(i - 1), {i, 1, Length[l]}]]; a = Table[ FromDigits[ IntegerDigits[n, 7]], {n, 0, 80}]; b = {}; Do[b = Append[b, f[a[[n]], 7]], {n, 1, 80}]; b

Formula

a(7*k+m) = -7*a(k)+m for 0 <= m < 7. - Chai Wah Wu, Jan 16 2020

A097582 Base 7 representation of the concatenation of the first n numbers with the most significant digits first.

Original entry on oeis.org

1, 15, 234, 3412, 50664, 1022634, 13331215, 206636142, 3026236221, 614636352655, 155123512633260, 35001313215554565, 10403265603212022112, 2132066345452131466644, 434014101450663623262042
Offset: 1

Views

Author

Cino Hilliard, Aug 29 2004

Keywords

Comments

Consider numbers of the form 1, 12, 123, 1234, ..., N. Find the highest power of 7^p such that 7^p < N. Then p = [log(N)/log(7)] and for 0 <= qi <= 6 [N/7^p] = q1 + r1 [r1/7^(p-1)] = q2 + r2 ........................ rp/7^1 = qp + rp+1 rp+1/7^0 = qp+1 0 For N = 1234, p = [log(1234)/log(7)] = 3 division quot rem 1234/7^3 = 3 205 205/7^2 = 4 9 9/7^1 = 1 2 2/7^0 = 2 0 The sequence of quotients, top down, forms the entry in the table for 1234. Obviously this algorithm works for any N.

Crossrefs

Formula

a(n) = A007093(A007908(n)). - Seiichi Manyama, Apr 23 2022

A346691 Replace 7^k with (-1)^k in base-7 expansion of n.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Jul 29 2021

Keywords

Comments

If n has base-7 expansion abc..xyz with least significant digit z, a(n) = z - y + x - w + ...

Examples

			83 = 146_7, 6 - 4 + 1 = 3, so a(83) = 3.
		

Crossrefs

Programs

  • Mathematica
    nmax = 104; A[] = 0; Do[A[x] = x (1 + 2 x + 3 x^2 + 4 x^3 + 5 x^4 + 6 x^5)/(1 - x^7) - (1 + x + x^2 + x^3 + x^4 + x^5 + x^6) A[x^7] + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
    Table[n + 8 Sum[(-1)^k Floor[n/7^k], {k, 1, Floor[Log[7, n]]}], {n, 0, 104}]
  • Python
    from sympy.ntheory.digits import digits
    def a(n):
        return sum(bi*(-1)**k for k, bi in enumerate(digits(n, 7)[1:][::-1]))
    print([a(n) for n in range(105)]) # Michael S. Branicky, Jul 29 2021

Formula

G.f. A(x) satisfies: A(x) = x * (1 + 2*x + 3*x^2 + 4*x^3 + 5*x^4 + 6*x^5) / (1 - x^7) - (1 + x + x^2 + x^3 + x^4 + x^5 + x^6) * A(x^7).
a(n) = n + 8 * Sum_{k>=1} (-1)^k * floor(n/7^k).

A037383 Numbers k such that every base-3 digit of k is a base-7 digit of k.

Original entry on oeis.org

1, 2, 13, 51, 63, 67, 68, 79, 84, 91, 99, 105, 134, 205, 211, 246, 252, 345, 351, 352, 354, 355, 357, 358, 359, 360, 361, 362, 363, 364, 366, 373, 380, 387, 394, 401, 406, 441, 442, 443, 444, 445, 446, 447, 448, 449, 454, 455, 457
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List ((\\), nub)
    a037383 n = a037383_list !! (n-1)
    a037383_list = filter f [1..] where
       f x = null $ nub (ds 3 x) \\ nub (ds 7 x)
       ds b x = if x > 0 then d : ds b x' else []  where (x', d) = divMod x b
    -- Reinhard Zumkeller, May 30 2013
    
  • Mathematica
    Select[Range[500],Complement[Union[IntegerDigits[#,3]],Union[IntegerDigits[#,7]]]=={}&] (* Harvey P. Dale, Jan 28 2024 *)
  • PARI
    upto(N) = my(s7); [n|n<-[1..N], setunion(Set(digits(n, 3)), s7=Set(digits(n, 7)))==s7]; \\ Ruud H.G. van Tol, May 09 2024

A102679 Number of digits >= 7 in decimal representation of n.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

a(n) = 0 iff n is in A007093 (numbers in base 7). - Bernard Schott, Feb 12 2023

Crossrefs

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=7 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(p(n),n=0..125); # Emeric Deutsch, Feb 23 2005

Formula

From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = Sum_{j=1..m+1} (floor(n/10^j + 3/10) - floor(n/10^j)), where m = floor(log_10(n)).
G.f.: g(x) = (1/(1-x))*Sum_{j>=0} (x^(7*10^j) - x^(10*10^j))/(1 - x^10^(j+1)). (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2005

A262104 Pseudoprimes to base 7, written in base 7.

Original entry on oeis.org

6, 34, 643, 1431, 2023, 2245, 3136, 5215, 6061, 6601, 10121, 12361, 16123, 20032, 25345, 33155, 41545, 42601, 42652, 44122, 45406, 50026, 54561, 56035, 66522, 66666, 105403, 110254, 112612, 113345, 113356, 123616, 135206, 140011, 151142, 151354, 153022, 153101, 153352, 155554
Offset: 1

Views

Author

Abdul Gaffar Khan, Sep 11 2015

Keywords

Crossrefs

Cf. A005938 (pseudoprimes to base 7), A007093 (numbers in base 7).

Programs

  • Mathematica
    base = 7; t = {}; n = 1;
    While[Length[t] < 40, n++;
    If[! PrimeQ[n] && PowerMod[base, n - 1, n] == 1,
      AppendTo[t, FromDigits@IntegerDigits[n, 7]]]]; t
    FromDigits[IntegerDigits[#,7]]&/@Select[Range[40000],CompositeQ[#] && PowerMod[ 7,#-1,#]==1&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Feb 24 2018 *)
  • PARI
    lista(nn, b=7) = {for (n=1, nn, if (Mod(b, n)^(n-1)==1 && !ispseudoprime(n) && n>1, print1(subst(Pol(digits(n,b), x), x, 10), ", ");););} \\ Michel Marcus, Sep 30 2015

Formula

a(n) = A007093(A005938(n)).

A353115 Base-7 representation of A000422(n).

Original entry on oeis.org

1, 30, 636, 15412, 314241, 5363433, 122026543, 2113022646, 33321631443, 536166343420, 143160211151106, 34336660114345260, 11025520662032415631, 2346534662055361221261, 535040660151320030232114, 150206616416004416563301662
Offset: 1

Views

Author

Seiichi Manyama, Apr 24 2022

Keywords

Crossrefs

Programs

  • Ruby
    def A(k, n)
      (1..n).map{|i| (1..i).to_a.reverse.join.to_i.to_s(k).to_i}
    end
    p A(7, 20)

Formula

a(n) = A007093(A000422(n)).

A004053 For m=2,3,..., write m in bases 2,3,..,m.

Original entry on oeis.org

10, 11, 10, 100, 11, 10, 101, 12, 11, 10, 110, 20, 12, 11, 10, 111, 21, 13, 12, 11, 10, 1000, 22, 20, 13, 12, 11, 10, 1001, 100, 21, 14, 13, 12, 11, 10, 1010, 101, 22, 20, 14, 13, 12, 11, 10, 1011, 102, 23, 21, 15, 14, 13, 12, 11, 10, 1100, 110, 30, 22, 20, 15, 14, 13, 12, 11, 10
Offset: 2

Views

Author

Johan Boye (johbo(AT)ida.liu.se)

Keywords

Examples

			Triangle begins:
    10;
    11,  10;
   100,  11, 10;
   101,  12, 11, 10;
   110,  20, 12, 11, 10;
   111,  21, 13, 12, 11, 10;
  1000,  22, 20, 13, 12, 11, 10;
  1001, 100, 21, 14, 13, 12, 11, 10;
  ...
		

Crossrefs

Programs

  • Mathematica
    FromDigits/@Flatten[Table[IntegerDigits[m,b],{m,2,20},{b,2,m}],1] (* Harvey P. Dale, Dec 01 2024 *)
  • PARI
    T(n, k) = fromdigits(digits(n, k), 10);
    tabl(nn) = for (n=2, nn, for (b=2, n, print1(T(n, b), ", "))); \\ Michel Marcus, Aug 30 2019
Previous Showing 11-20 of 204 results. Next