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.

A337239 Numbers having at least one 7 in their representation in base 8.

This page as a plain text file.
%I A337239 #34 Dec 05 2024 12:02:53
%S A337239 7,15,23,31,39,47,55,56,57,58,59,60,61,62,63,71,79,87,95,103,111,119,
%T A337239 120,121,122,123,124,125,126,127,135,143,151,159,167,175,183,184,185,
%U A337239 186,187,188,189,190,191,199,207,215,223,231,239,247,248,249,250,251,252,253,254,255
%N A337239 Numbers having at least one 7 in their representation in base 8.
%C A337239 Complementary sequence to A037474.
%H A337239 François Marques, <a href="/A337239/b337239.txt">Table of n, a(n) for n = 1..10000</a>
%e A337239 54 is not in the sequence since it is 66_8 in base 8, but 55 is in the sequence since it is 67_8 in base 8.
%p A337239 seq(`if`(numboccur(7, convert(n, base, 8))>0, n, NULL), n=0..100);
%t A337239 Select[ Range[ 0, 100 ], (Count[ IntegerDigits[ #, 8 ], 7 ]>0)& ]
%o A337239 (PARI) isok(m) = #select(x->(x==7), digits(m, 8)) >= 1;
%o A337239 (Python)
%o A337239 def A337239(n):
%o A337239     def f(x):
%o A337239         s = oct(x)[2:]
%o A337239         l = s.find('7')
%o A337239         if l >= 0:
%o A337239             s = s[:l]+'6'*(len(s)-l)
%o A337239         return n+int(s,7)
%o A337239     m, k = n, f(n)
%o A337239     while m != k: m, k = k, f(k)
%o A337239     return m # _Chai Wah Wu_, Dec 04 2024
%Y A337239 Cf. Numbers with at least one digit b-1 in base b : A074940 (b=3), A337250 (b=4), A337572 (b=5), A333656 (b=6), A337141 (b=7), this sequence (b=8), A338090 (b=9), A011539 (b=10), A095778 (b=11).
%Y A337239 Cf. Numbers with no digit b-1 in base b: A005836 (b=3), A023717 (b=4), A020654 (b=5), A037465 (b=6), A020657 (b=7), A037474 (b=8), A037477 (b=9), A007095 (b=10), A171397 (b=11).
%K A337239 nonn,base,easy
%O A337239 1,1
%A A337239 _François Marques_, Sep 20 2020