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.

A109848 Highest common factor of n and its 9's complement.

This page as a plain text file.
%I A109848 #14 Sep 03 2018 22:58:50
%S A109848 1,1,3,1,1,3,1,1,9,1,11,3,1,1,3,1,1,9,1,1,3,11,1,3,1,1,9,1,1,3,1,1,33,
%T A109848 1,1,9,1,1,3,1,1,3,1,11,9,1,1,3,1,1,3,1,1,9,11,1,3,1,1,3,1,1,9,1,1,33,
%U A109848 1,1,3,1,1,9,1,1,3,1,11,3,1,1,9,1,1,3,1,1,3,11,1,9,1,1,3,1,1,3,1,1,99,1,1,3
%N A109848 Highest common factor of n and its 9's complement.
%H A109848 Harvey P. Dale, <a href="/A109848/b109848.txt">Table of n, a(n) for n = 1..1000</a>
%e A109848 a(55)=11 because the 9's complement of 55 is 99 - 55 = 44 and the greatest common divisor of 44 and 55 is 11.
%p A109848 digs := proc(inp::integer) local resul,shiftinp : resul := 1 : shiftinp := iquo(inp,10) : while shiftinp > 0 do resul := resul+1 : shiftinp := iquo(shiftinp,10) : od : RETURN(resul) : end: nin := proc(inp::integer) RETURN(10^digs(inp)-1-inp) : end : for n from 1 to 80 do comp := nin(n) ; #print(n,comp,gcd(n,comp)) ; printf("%d,",gcd(n,comp)) ; od : # _R. J. Mathar_, Mar 27 2006
%t A109848 hcf[n_]:=Module[{idn=IntegerDigits[n],c9},c9=FromDigits[PadRight[{}, Length[idn],9]-idn];GCD[n,c9]]; Array[hcf,110] (* _Harvey P. Dale_, Dec 18 2012 *)
%Y A109848 Cf. A109847, A084021.
%K A109848 base,easy,nonn
%O A109848 1,3
%A A109848 _Amarnath Murthy_, Jul 06 2005
%E A109848 Corrected and extended by _R. J. Mathar_, Mar 27 2006
%E A109848 More terms from _Joshua Zucker_, May 03 2006