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 239 results. Next

A029805 Numbers k such that k^2 is palindromic in base 8.

Original entry on oeis.org

0, 1, 2, 3, 6, 9, 11, 27, 65, 73, 79, 81, 83, 195, 219, 237, 366, 513, 543, 585, 697, 1094, 1539, 1755, 1875, 2910, 4097, 4161, 4225, 4477, 4617, 4681, 4727, 4891, 5267, 8698, 8730, 11841, 12291, 12483, 12675, 13065, 13851, 14673, 15021
Offset: 1

Views

Author

Keywords

Comments

The only powers of 2 in this sequence are 1 and 2. - Alonso del Arte, Feb 25 2017

Examples

			3 is in the sequence because 3^2 = 9 = 11 in base 8, which is a palindrome.
4 is not in the sequence because 4^2 = 16 = 20 in base 8, which is not a palindrome.
		

Crossrefs

Numbers k such that k^2 is palindromic in base b: A003166 (b=2), A029984 (b=3), A029986 (b=4), A029988 (b=5), A029990 (b=6), A029992 (b=7), this sequence (b=8), A029994 (b=9), A002778 (b=10), A029996 (b=11), A029737 (b=12), A029998 (b=13), A030072 (b=14), A030073 (b=15), A029733 (b=16), A118651 (b=17).

Programs

  • Mathematica
    palQ[n_, b_:10] := Module[{idn = IntegerDigits[n, b]}, idn == Reverse[idn]]; Select[Range[0, 16000], palQ[#^2, 8] &] (* Harvey P. Dale, May 19 2012 *)
  • Python
    from itertools import count, islice
    def A029805_gen(): # generator of terms
        return filter(lambda k: (s:=oct(k**2)[2:])[:(t:=(len(s)+1)//2)]==s[:-t-1:-1],count(0))
    A029805_list = list(islice(A029805_gen(),20)) # Chai Wah Wu, Jun 23 2022

A073789 Numbers in base -8.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 170, 171, 172, 173, 174, 175, 176, 177, 160, 161, 162, 163, 164, 165, 166, 167, 150, 151, 152, 153, 154, 155, 156, 157, 140, 141, 142, 143, 144, 145, 146, 147, 130, 131, 132, 133, 134, 135, 136, 137, 120, 121, 122, 123, 124, 125, 126
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

  • Haskell
    a073789 0 = 0
    a073789 n = a073789 n' * 10 + m where
       (n', m) = if r < 0 then (q + 1, r + 8) else (q, r)
                 where (q, r) = quotRem n (negate 8)
    -- Reinhard Zumkeller, Jul 07 2012
    
  • Mathematica
    ToNegaBases[i_Integer, b_Integer] := FromDigits[ Rest[ Reverse[ Mod[ NestWhileList[(#1 - Mod[ #1, b])/-b &, i, #1 != 0 &], b]]]]; Table[ ToNegaBases[n, 8], {n, 0, 60}]
  • Python
    def A073789(n):
        s, q = '', n
        while q >= 8 or q < 0:
            q, r = divmod(q, -8)
            if r < 0:
                q += 1
                r += 8
            s += str(r)
        return int(str(q)+s[::-1]) # Chai Wah Wu, Apr 09 2016

A255805 Numbers with no zeros in base-8 representation.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 73, 74, 75, 76, 77, 78, 79, 81, 82, 83, 84
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 08 2015

Keywords

Comments

Different from A047592, A207481.

Crossrefs

Cf. A007094, A100970 (subsequence).
Zeroless numbers in some other bases <= 10: A000042 (base 2), A032924 (base 3), A023705 (base 4), A248910 (base 6), A255808 (base 9), A052382 (base 10).

Programs

  • Haskell
    a255805 n = a255805_list !! (n-1)
    a255805_list = iterate f 1 where
       f x = 1 + if r < 7 then x else 8 * f x'  where (x', r) = divMod x 8
    
  • Mathematica
    Select[Range[100],DigitCount[#,8,0]==0&] (* Harvey P. Dale, Jun 08 2015 *)
  • PARI
    isok(m) = vecmin(digits(m,8)) > 0; \\ Michel Marcus, Jan 23 2022
    
  • Python
    def ok(n): return '0' not in oct(n)[2:]
    print([k for k in range(85) if ok(k)]) # Michael S. Branicky, Jan 23 2022
    
  • Python
    from sympy import integer_log
    def A255805(n):
        m = integer_log(k:=6*n+1,7)[0]
        return sum(1+(k-7**m)//(6*7**j)%7<<3*j for j in range(m)) # Chai Wah Wu, Jun 28 2025

A097583 Octal representation of the concatenation of the first n decimal numbers with the most significant digits first.

Original entry on oeis.org

1, 14, 173, 2322, 30071, 361100, 4553207, 57060516, 726746425, 133767016076, 21756176604103, 3404420603635070, 536705213574536755, 104420417226264430242, 15305164771273206577527
Offset: 1

Views

Author

Cino Hilliard, Aug 29 2004

Keywords

Examples

			1234 decimal is 2322 octal the 4th entry in the table.
		

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[IntegerDigits[FromDigits[Flatten[IntegerDigits/@ Range[ n]]],8]],{n,20}] (* Harvey P. Dale, Aug 11 2021 *)

Formula

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

A073795 Replace 8^k with (-8)^k in base 8 expansion of n.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Aug 12 2002

Keywords

Comments

Base 8 representation for n (in lexicographic order) converted from base -8 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, 8]], {n, 0, 80}]; b = {}; Do[b = Append[b, f[a[[n]], 8]], {n, 1, 80}]; b

Formula

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

A088152 Value of n-th digit in octal representation of n^n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Sep 20 2003

Keywords

Comments

a(n)=d(n) with n^n = Sum(d(k)*8^k: 0<=d(k)<8, k>=0).

Examples

			n=9, 9^9=387420489 -> '2705710511', '2---------': a(9)=2;
a(0)=1, a(k)=0 for 0<k<8 and a(8)=1.
		

Crossrefs

Programs

  • Magma
    [Floor(n^n/8^n) mod 8:n in [0..101]]; // Marius A. Burtea, Sep 20 2019
  • Maple
    f:= proc(n) local x,L;
       x:= n &^ n mod 8^(n+1);
       floor(x/8^n)
    end proc:
    f(0):= 1:
    map(f, [$0..101]); # Robert Israel, Sep 19 2019

Formula

a(n) = floor(n^n / 8^n) mod 8.

A037384 Numbers k such that every base-3 digit of k is a base-8 digit of k.

Original entry on oeis.org

1, 2, 13, 17, 26, 66, 80, 112, 120, 121, 122, 129, 136, 161, 168, 202, 242, 328, 394, 401, 458, 514, 522, 528, 529, 530, 531, 532, 533, 534, 535, 538, 546, 554, 562, 570, 578, 592, 610, 634, 640, 641, 642, 643, 644, 645, 646, 647
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List ((\\), nub)
    a037384 n = a037384_list !! (n-1)
    a037384_list = filter f [1..] where
       f x = null $ nub (ds 3 x) \\ nub (ds 8 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
    b3b8Q[n_]:=Module[{b3=Union[IntegerDigits[n,3]],b8=Union[ IntegerDigits[n,8]]}, And@@Table[ MemberQ[b8,b3[[i]]],{i,Length[b3]}]]; Select[Range[700],b3b8Q] (* Harvey P. Dale, Apr 17 2013 *)
  • PARI
    is(n)=#setminus(Set(digits(n,3)), Set(digits(n,8)))==0 \\ Charles R Greathouse IV, Feb 11 2017

A190130 Numbers 1 through 10000 sorted lexicographically in octal representation (base 8).

Original entry on oeis.org

1, 8, 64, 512, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 513, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 514, 4112, 4113, 4114, 4115, 4116, 4117, 4118, 4119, 515, 4120, 4121, 4122, 4123, 4124, 4125, 4126, 4127, 516, 4128, 4129, 4130, 4131, 4132
Offset: 1

Views

Author

Reinhard Zumkeller, May 06 2011

Keywords

Comments

A190131 = inverse permutation: a(A190131(n)) = A190131(a(n)) = n;
a(n) <> n for n > 1.

Examples

			a(10) = 4101 -> 10005 [oct];
a(11) = 4102 -> 10006 [oct];
a(12) = 4103 -> 10007 [oct];
a(13) =  513 -> 1001  [oct];
a(14) = 4104 -> 10010 [oct];
a(15) = 4105 -> 10011 [oct];
a(16) = 4106 -> 10012 [oct];
largest term a(67151) = 10000 -> 23420 [oct];
last term a(10000) = 4095 -> 7777 [oct], largest term lexicographically.
		

Crossrefs

A007094; A190126 (base 2), A190128 (base 3), A190016 (base 10), A190132 (base 12), A190134 (base 16).

Programs

  • Haskell
    import Data.Ord (comparing)
    import Data.List (sortBy)
    a190130 n = a190130_list !! (n-1)
    a190130_list = sortBy (comparing (show . a007094)) [1..10000]

A262105 Pseudoprimes to base 8, written in base 8.

Original entry on oeis.org

11, 25, 55, 77, 101, 151, 165, 205, 231, 347, 421, 525, 741, 777, 1061, 1111, 1205, 1213, 1535, 1665, 1751, 2121, 2401, 2525, 2553, 2611, 3005, 3161, 3175, 3301, 3371, 3561, 3777, 4171, 4641, 4705, 5215, 5405, 6111, 6143
Offset: 1

Views

Author

Abdul Gaffar Khan, Sep 11 2015

Keywords

Crossrefs

Cf. A007094 (Numbers in base 8), A020137 (Pseudoprimes to base 8).

Programs

  • Mathematica
    base = 8; t = {}; n = 1;
      While[Length[t] < 40, n++;
       If[! PrimeQ[n] && PowerMod[base, n - 1, n] == 1, AppendTo[t, FromDigits@ IntegerDigits[n, 8]]]];  t

Formula

a(n) = A007094(A020137(n)).

A293661 Base-8 circular primes that are not base-8 repunits.

Original entry on oeis.org

13, 29, 31, 41, 43, 47, 59, 61, 607, 719, 751, 761, 971, 1021, 1657, 1759, 1787, 1913, 1993, 2011, 2687, 3019, 3659, 3673, 3677, 3803, 3919, 4073, 49103, 56299, 62207, 105341, 130681, 177007, 188249, 195277, 235513, 237151, 251501, 259019, 4127707, 6807419
Offset: 1

Views

Author

Felix Fröhlich, Dec 30 2017

Keywords

Comments

Conjecture: The sequence is finite.
From Michael De Vlieger, Dec 30 2017: (Start)
Primes in this sequence must only have odd digits.
There are 8 terms with 2 octal digits, 20 terms with 4 octal digits, 12 terms with 6 octal digits, and 8 terms with 8 octal digits.
a(49), if it exists, must be larger than 8^12 = 68719476736. (End)

Examples

			607 written in base 8 is 1137. The base-8 numbers 1137, 1371, 3711, 7113 written in base 10 are 607, 761, 1993, 3659, respectively, and all those numbers are prime, so 607, 761, 1993 and 3659 are terms of the sequence.
		

Crossrefs

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

Programs

  • Mathematica
    With[{b = 8}, Select[Prime@ Range[PrimePi@ b + 1, 10^6], Function[w, And[AllTrue[Array[FromDigits[RotateRight[w, #], b] &, Length@ w - 1], PrimeQ], Union@ w != {1} ]]@ IntegerDigits[#, b] &]] (* or *)
    With[{b = 8}, Select[Flatten@ Array[FromDigits[#, b] & /@ Most@ Rest@ Tuples[Range[1, 7, 2], #] &, 6, 2], Function[w, And[ AllTrue[ Array[ FromDigits[ RotateRight[w, #], b] &, Length@ w], 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, 8))!=vecmax(digits(p, 8)), if(is_circularprime(p, 8), print1(p, ", "))))
Previous Showing 11-20 of 239 results. Next